From f87945a8d104adc08216762c9ac57debf095707f Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Wed, 25 Jul 2012 17:39:16 +0100 Subject: 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 Acked-by: Ian Jackson Committed-by: Ian Campbell --- tools/hotplug/Linux/network-bridge | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tools') 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 } -- cgit v1.2.3