All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][NET] Handle netdev secondary addresses and labels
@ 2008-01-03 14:29 Mark McLoughlin
  0 siblings, 0 replies; only message in thread
From: Mark McLoughlin @ 2008-01-03 14:29 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 944 bytes --]

Fix the network-bridge logic to correctly transfer secondary IP address
from $netdev to $bridge.

e.g. if you add an secondary address/label/alias with:

  $> ip addr add 172.31.0.200/24 dev eth0 label eth0:00

then, "ip addr show dev eth0" gives e.g.:

  inet 172.31.0.10/24 brd 172.31.0.255 scope global eth0
  inet 172.31.0.200/24 scope global secondary eth0:00

and transfer_addrs() tries to execute:

  ip addr add 172.31.0.10/24 brd 172.31.0.255 scope global dev tmpbridge
  ip addr add 172.31.0.200/24 scope global secondary dev tmpbridge:00

which causes the sript to fail because:

  1) The device tmpbridge:00 doesn't exist
  2) The "secondary" flag isn't valid

This patch fixes the sed commands to instead give:

  ip addr add 172.31.0.10/24 brd 172.31.0.255 scope global dev tmpbridge label tmpbridge
  ip addr add 172.31.0.200/24 scope global dev tmpbridge label tmpbridge:00

Signed-off-by: Mark McLoughlin <markmc@redhat.com>



[-- Attachment #2: xen-network-bridge-handle-secondary-addresses.patch --]
[-- Type: text/x-patch, Size: 526 bytes --]

diff -r 2491691e3e69 tools/examples/network-bridge
--- a/tools/examples/network-bridge	Sat Dec 29 17:57:47 2007 +0000
+++ b/tools/examples/network-bridge	Thu Jan 03 14:19:14 2008 +0000
@@ -121,7 +121,8 @@ transfer_addrs () {
     ip addr show dev ${src} | egrep '^ *inet ' | sed -e "
 s/inet/ip addr add/
 s@\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+/[0-9]\+\)@\1@
-s/${src}/dev ${dst}/
+s/${src}/dev ${dst} label ${dst}/
+s/secondary//
 " | sh -e
     # Remove automatic routes on destination device
     ip route list | sed -ne "

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-01-03 14:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-03 14:29 [PATCH][NET] Handle netdev secondary addresses and labels Mark McLoughlin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.