[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Route script, ifup and IPv6.



Hello,

will someone finally begin listening to my comments on GNU/kFreeBSD.

The script /sbin/route is really a tie-down for GNU/kFreeBSD.
It is completely tied to IPv4 and to exactly handle ifup/ifdown.
Nothing else. The patch reprinted below, begins making those
alteration that let "/sbin/route" catch all "route add"-commands
that "ifup" care to send, be it IPv4 or Ipv6.

The new script is not able to set up IPv6 properly, simply because
the call to "ifconfig" from "ifup" is a pure gnu-linux-ism:

    ifconfig bge0 add 2001:fake:beef::1/64

This fails with a bad address under GNU/kFreeBSD. The correct call
needs a domain specifier:

    ifconfig bge0 add inet6 2001:fake:beef::1/64

The format string in "ifup" will never catch this.


Given my changes to the script "/sbin/route", it is now able to
configure my native IPv6 support using a boot script

    ## /etc/rc.local

    ifconfig bge0 add inet6 2001:fake:beef::1234/80

    # Imitate call from "ifup"
    route add -A inet6 default 2001:fake:beef::1/80 bge0

    # Native call
    ## route add -inet6 default 2001:fake:beef::1/80


The script still distroys most capacieties of /lib/freebsd/route.
I have inserted some remarks to serve as ugly signals on this.
The discarding of interface names is really ugly. This happens
due to the pattern "*[0-9]". It must be replaced by something
context sensitive. The option "-interface" must be invoked
to set the routing device.

The old manipulations, after finding "default", are plainly useless.
Rather they distroy already correct functionality, since they expand
to an interpretation that exists, is unnecessary, but is false for IPv6.

These are harsh words, but my disappointment with GNU/kFreeBSD
for IPv6 has grown steadily ever since Summer.

Regards,

Mats Erik Andersson, DM



--- /sbin/route.orig
+++ /sbin/route
@@ -12,20 +12,28 @@
 
 while [ $# -gt 0 ]; do
   case "$1" in
-    default)
-      shift
-      if [ "$1" = "gw" ] ; then shift ; fi
-      args="${args} -net 0.0.0.0 $1"
-    ;;
+    gw)
+      # Not usable on FreeBSD
+      ;;
+    -A) # Set address domain
+      shift; args="${args} -$1" ;;
+    -*) # General options
+      args="${args} $1" ;;
     *.*.*.*) args="${args} $1" ;;
-    *[0-9]) ;;
+    *:*) # Try to catch IPv6
+      args="${args} $1" ;;
+    *[0-9]) # TODO: Ugly catch of interface names
+            #       Breaks most FreeBSD usages
+      ;;
     *) args="${args} $1" ;;
   esac
   shift
 done
 
+# Hack for ifup
 if [ ${cmd} = "del" ] ; then
   cmd=""
+  # Ignores distinction of IPv4 and IPv6
   args="-q flush"
 fi
 


Reply to: