chiark / gitweb /
svc/tripe-ifup.in: Bring up the interface before adding routes.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 21 Mar 2012 19:04:27 +0000 (19:04 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 21 Mar 2012 19:04:27 +0000 (19:04 +0000)
It doesn't work the other way around.  Except when I was testing it, for
some reason.

svc/tripe-ifup.in

index 8ca0c99..4d4c5b7 100644 (file)
@@ -107,6 +107,25 @@ case $have6,$# in
 esac
 
 ###--------------------------------------------------------------------------
+### Bring the interface up.
+
+case $haveaddr4,$haveaddr6 in
+  nil,nil)
+    ;;
+  *)
+    case "${P_MTU+set}" in
+      set)
+       mtu=$P_MTU;;
+      *)
+       pathmtu=$(pathmtu "$addr")
+       mtu=$(expr "$pathmtu" - 33 - $A_CIPHER_BLKSZ - $A_MAC_TAGSZ)
+       ;;
+    esac
+    ip link set dev "$ifname" up mtu "$mtu"
+    ;;
+esac
+
+###--------------------------------------------------------------------------
 ### Set up routing.
 
 ## Split the routes into v4 and v6 lists.
@@ -139,25 +158,6 @@ case $haveaddr6,$# in
 esac
 
 ###--------------------------------------------------------------------------
-### Bring the interface up.
-
-case $haveaddr4,$haveaddr6 in
-  nil,nil)
-    ;;
-  *)
-    case "${P_MTU+set}" in
-      set)
-       mtu=$P_MTU;;
-      *)
-       pathmtu=$(pathmtu "$addr")
-       mtu=$(expr "$pathmtu" - 33 - $A_CIPHER_BLKSZ - $A_MAC_TAGSZ)
-       ;;
-    esac
-    ip link set dev "$ifname" up mtu "$mtu"
-    ;;
-esac
-
-###--------------------------------------------------------------------------
 ### Maybe invoke a follow-on script.
 
 case "${P_IFUPEXTRA+set}" in