aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-01-08 09:43:44 +0000
committerKeir Fraser <keir.fraser@citrix.com>2008-01-08 09:43:44 +0000
commit83501deecf218877bc0aa745180686ddc9c2159c (patch)
treea8842ed1bdfad28df1ff07cb6342fb576dd7f748
parent24895b5f9b8288d7320f13025711980eff492111 (diff)
downloadxen-83501deecf218877bc0aa745180686ddc9c2159c.tar.gz
xen-83501deecf218877bc0aa745180686ddc9c2159c.tar.bz2
xen-83501deecf218877bc0aa745180686ddc9c2159c.zip
Handle netdev secondary addresses and labels
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>
-rwxr-xr-xtools/examples/network-bridge3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/examples/network-bridge b/tools/examples/network-bridge
index d558b9f552..9244f0a75c 100755
--- a/tools/examples/network-bridge
+++ b/tools/examples/network-bridge
@@ -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 "