From: Ansis Atteka Date: Mon, 16 Apr 2012 06:30:15 +0000 (-0700) Subject: ovs-save: Add "dev" keyword before interface names in the ip commands X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=200940deb7c85de7afe3e52edabf574088ac01e3;p=openvswitch ovs-save: Add "dev" keyword before interface names in the ip commands 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 --- diff --git a/utilities/ovs-save b/utilities/ovs-save index 323d1845..de312904 100755 --- a/utilities/ovs-save +++ b/utilities/ovs-save @@ -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