[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] tools/hotplug/Linux: don't needlessly use non-standard features in vif-{bridge, route}



commit b11910082d90bb1597f6679524eb726a33306672
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed Sep 2 08:09:28 2020 +0200
Commit:     Wei Liu <wl@xxxxxxx>
CommitDate: Mon Sep 7 14:28:59 2020 +0000

    tools/hotplug/Linux: don't needlessly use non-standard features in 
vif-{bridge,route}
    
    We're not after any "fall-through" behavior here. Replace the constructs
    with ones understood by all conforming shells, including older bash
    (problem observed with 3.1.51(1)).
    
    Fixes: b51715f02bf9 ("tools/hotplug/Linux: remove code duplication in 
vif-bridge")
    Fixes: 3683290fc0b0 ("tools/hotplug: only attempt to call 'ip route' if 
there is valid command")
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Paul Durrant <paul@xxxxxxx>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>
    Acked-by: Wei Liu <wl@xxxxxxx>
---
 tools/hotplug/Linux/vif-bridge | 8 ++------
 tools/hotplug/Linux/vif-route  | 8 ++------
 2 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/tools/hotplug/Linux/vif-bridge b/tools/hotplug/Linux/vif-bridge
index b99cc82a21..906047e82f 100644
--- a/tools/hotplug/Linux/vif-bridge
+++ b/tools/hotplug/Linux/vif-bridge
@@ -77,16 +77,12 @@ then
 fi
 
 case "$command" in
-    add)
-        ;&
-    online)
+    add|online)
         setup_virtual_bridge_port "$dev"
         set_mtu "$bridge" "$dev" "$type_if"
         add_to_bridge "$bridge" "$dev"
         ;;
-    remove)
-        ;&
-    offline)
+    remove|offline)
         remove_from_bridge "$bridge" "$dev"
         ;;
 esac
diff --git a/tools/hotplug/Linux/vif-route b/tools/hotplug/Linux/vif-route
index 05199bf741..9cd417a005 100755
--- a/tools/hotplug/Linux/vif-route
+++ b/tools/hotplug/Linux/vif-route
@@ -22,17 +22,13 @@ dir=$(dirname "$0")
 main_ip=$(dom0_ip)
 
 case "${command}" in
-    add)
-        ;&
-    online)
+    add|online)
         ifconfig ${dev} ${main_ip} netmask 255.255.255.255 up
         echo 1 >/proc/sys/net/ipv4/conf/${dev}/proxy_arp
         ipcmd='add'
         cmdprefix=''
         ;;
-    remove)
-        ;&
-    offline)
+    remove|offline)
         do_without_error ifdown ${dev}
         ipcmd='del'
         cmdprefix='do_without_error'
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.