Xen 
 
Home Products Support Community News
 
   
First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 1142
Product:  
Component:  
Status: NEW
Resolution:
Assigned To: Xen Bug List <xen-bugs@lists.xensource.com>
Hardware:  
OS:  
Version:  
Priority:  
Severity:  
Reporter: shadow@overdrawn.net
Add CC:
CC:
Remove selected CCs
URL:
Summary:

Attachment Type Created Size Actions
xen-tools-3.3.0-network-bridge-multiple-ips.patch patch 2008-09-20 16:04 1.14 KB Edit
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 1142 depends on: Show dependency tree
Show dependency graph
Bug 1142 blocks:

Additional Comments:









View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Opened: 2008-01-16 12:42
This is all on gentoo, 2.6.20 kernel + xen 3.1.2 ebuild

This seems to be due to a bug in the network-bridge script on line 72:
addr_pfx=`ip addr show dev eth0 | sed -n 's/^ *inet \(.*\) [^ ]*$/\1/p'`

On another box it returns: 192.168.0.50/24
On my box it returns: 192.168.1.21/24 brd 192.168.1.255 scope link inet6
fe80::2e0:81ff:fe28:4bd9/64 scope link

This causes line 83: ip addr add ${addr_pfx} dev $1
to fail with:
either local is duplicate or inet6 is a garbage

I've disabled ipv6 as a workaround since I don't need it and so far everything
seems to be running properly.

------- Comment #1 From Peter Große 2008-02-12 20:23 -------
The problem resides in the network-bridge script, which can't handle more than
one IP address on the interface. IPv6 is NOT the problem.

If you have multiple IPs (IPv4 and/or IPv6) on the interface the grep in the
"addr_pfx=..." line returns
more than one line and "ip addr add ${addr_pfx} dev $1" will fail. 

I found an approrach to fix this killing interface behavior based on
http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=332.

--- network-bridge.dist 2008-02-13 01:18:07.000000000 +0100
+++ network-bridge      2008-02-13 04:33:40.000000000 +0100
@@ -90,7 +90,7 @@
 tdev=tmpbridge

 get_ip_info() {
-    addr_pfx=`ip addr show dev $1 | egrep '^ *inet' | sed -e 's/ *inet //' -e
"s/$1//"`
+    addr_pfx=`ip addr show dev $1 | grep -v dynamic | egrep '^ *inet' | sed -e
's/ *inet6\? //' -e "s/$1//"`
     gateway=`ip route show dev $1 | fgrep default | sed 's/default via //'`
 }

@@ -99,7 +99,7 @@
         if [ -n "$addr_pfx" ] ; then
             # use the info from get_ip_info()
             ip addr flush $1
-            ip addr add ${addr_pfx} dev $1
+            for address in `echo "${addr_pfx}"`; do ip addr add ${address} dev
$1; done
             ip link set dev $1 up
             [ -n "$gateway" ] && ip route add default via ${gateway}
         fi

This patch adds support for multiple IPv4 and v6 addresses on the interface.

Discussed at https://bugs.gentoo.org/show_bug.cgi?id=111684

------- Comment #2 From Peter Große 2008-09-20 16:04 -------
Created an attachment (id=811) [edit]
xen-tools-3.3.0-network-bridge-multiple-ips.patch

reworked patch attached.

should resolve this issue.

First Last Prev Next    No search results available      Search page      Enter new bug