diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2012-07-25 17:39:16 +0100 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2012-07-25 17:39:16 +0100 |
commit | f87945a8d104adc08216762c9ac57debf095707f (patch) | |
tree | ec12cfa5b2c8c2b41095c30499c1702bb76196a5 | |
parent | d64a3a3e6a421ae0746cd4108e11b79e6d1238d4 (diff) | |
download | xen-f87945a8d104adc08216762c9ac57debf095707f.tar.gz xen-f87945a8d104adc08216762c9ac57debf095707f.tar.bz2 xen-f87945a8d104adc08216762c9ac57debf095707f.zip |
hotplug: network-bridge: fix for interfaces with no gateway
This comes from an old Debian bug report
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=588477 which refers to
http://lists.xen.org/archives/html/xen-users/2010-06/msg00420.html.
Although we no longer have a trap in _claim_lock as described (this was removed
in 25590:bb250383a4f5 "hotplug/Linux: use flock based locking") and the use of
network-* scripts is discouraged (in favour of using distro provided
mechanisms) the general principal that relying on the semantics of /bin/sh's &&
is unwise seems sound.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
-rw-r--r-- | tools/hotplug/Linux/network-bridge | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/hotplug/Linux/network-bridge b/tools/hotplug/Linux/network-bridge index 6f8475acb7..9aa9dda484 100644 --- a/tools/hotplug/Linux/network-bridge +++ b/tools/hotplug/Linux/network-bridge @@ -115,7 +115,9 @@ do_ifup() { ip addr add ${addr_pfx} dev $1 fi ip link set dev $1 up - [ -n "$gateway" ] && ip route add default via ${gateway} + if [ -n "$gateway" ] ; then + ip route add default via ${gateway} + fi fi } |