ovs-save: Add "dev" keyword before interface names in the ip commands
authorAnsis Atteka <aatteka@nicira.com>
Mon, 16 Apr 2012 06:30:15 +0000 (23:30 -0700)
committerAnsis Atteka <aatteka@nicira.com>
Mon, 16 Apr 2012 17:08:20 +0000 (10:08 -0700)
The "service force-reload-kmod" command did not work properly, if there
was a bridge, which name was a prefix of string "broadcast" (e.g. "br").

To reproduce:
ovs-vsctl add-br br
service openvswitch-switch force-reload-kmod

This patch will make sure that the generated ip commands are clearly
interpretable by the ip utility.

Issue #9841
Signed-off-by: Ansis Atteka <aatteka@nicira.com>
utilities/ovs-save

index 323d184..de31290 100755 (executable)
@@ -54,7 +54,7 @@ fi
 
 devs=$*
 for dev in $devs; do
-    state=`ip link show $dev` || continue
+    state=`ip link show dev $dev` || continue
 
     echo "# $dev"
     # Link state (Ethernet addresses, up/down, ...)
@@ -83,12 +83,12 @@ for dev in $devs; do
         linkcmd="$linkcmd mtu $mtu"
     fi
     if test -n "$linkcmd"; then
-        echo ip link set $dev down # Required to change hwaddr.
-        echo ip link set $dev $linkcmd
+        echo ip link set dev $dev down # Required to change hwaddr.
+        echo ip link set dev $dev $linkcmd
     fi
 
     # IP addresses (including IPv6).
-    echo "ip addr flush $dev 2>/dev/null" # Suppresses "Nothing to flush".
+    echo "ip addr flush dev $dev 2>/dev/null" # Suppresses "Nothing to flush".
     ip addr show dev $dev | while read addr; do
         set -- $addr