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

[Xen-changelog] [xen-unstable] hotplug: network-bridge: fix for interfaces with no gateway


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Thu, 26 Jul 2012 20:55:09 +0000
  • Delivery-date: Thu, 26 Jul 2012 20:55:20 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1343234356 -3600
# Node ID e37bd3d6f769a9604adacbef747d9dff9705e69a
# Parent  c8f1e4a98f7f10c095377e8f7c61dc07fb203dfd
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@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---


diff -r c8f1e4a98f7f -r e37bd3d6f769 tools/hotplug/Linux/network-bridge
--- a/tools/hotplug/Linux/network-bridge        Wed Jul 25 17:39:15 2012 +0100
+++ b/tools/hotplug/Linux/network-bridge        Wed Jul 25 17:39:16 2012 +0100
@@ -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
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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