2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-27 15:18:06 +00:00

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 <aatteka@nicira.com>
This commit is contained in:
Ansis Atteka
2012-04-15 23:30:15 -07:00
parent f1936eb651
commit 200940deb7

View File

@@ -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