[ovs-dev] [PATCH] ovs-save: Add "dev" keyword before interface names in the ip commands

Kyle Mestery (kmestery) kmestery at cisco.com
Mon Apr 16 13:10:47 UTC 2012


This looks great, but a quick grep found the "ip link" command used in this script as well:

xenserver/etc_xensource_scripts_vif

Since that script is for xenserver, I assume the same issue found below won't exist there?

Thanks,
Kyle

On Apr 16, 2012, at 1:35 AM, Ansis Atteka wrote:

> 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 at nicira.com>
> ---
> utilities/ovs-save |    8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/utilities/ovs-save b/utilities/ovs-save
> index 323d184..de31290 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
> 
> -- 
> 1.7.9.1
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev




More information about the dev mailing list