Bridging does not work correctly in net-common. The parameters passed
by Ganeti are put in /var/run/ganeti/xen-hypervisor/nic/$domname/$devid
and read again from there before running the setup functions according
to the $MODE which is read from the file.

When using MODE=bridged, the script expects to get the name of the
bridge passed as $BRIDGE, but is actually stored and passed as $LINK.
This patch fixes the issue.

Signed-off-by: Sebastian Gebhard <[email protected]>
---
 tools/net-common.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/net-common.in b/tools/net-common.in
index ee412bd..05fff64 100644
--- a/tools/net-common.in
+++ b/tools/net-common.in
@@ -50,10 +50,10 @@ function setup_bridge {
   if [ "$MODE" = "bridged" ]; then
     fix_mac
     ip link set $INTERFACE up
-    ip link set $INTERFACE mtu $(</sys/class/net/${BRIDGE}/mtu)
+    ip link set $INTERFACE mtu $(</sys/class/net/${LINK}/mtu)
 
     # Connect the interface to the bridge
-    brctl addif $BRIDGE $INTERFACE
+    brctl addif $LINK $INTERFACE
   fi
 
 }
-- 
1.8.1.2

Reply via email to