From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark McLoughlin Subject: [PATCH][NET] Handle netdev secondary addresses and labels Date: Thu, 03 Jan 2008 14:29:44 +0000 Message-ID: <1199370584.4259.9.camel@muff> Reply-To: Mark McLoughlin Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-6BDCUZsTRVL5AzaaQ90X" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --=-6BDCUZsTRVL5AzaaQ90X Content-Type: text/plain Content-Transfer-Encoding: 7bit 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 --=-6BDCUZsTRVL5AzaaQ90X Content-Disposition: attachment; filename=xen-network-bridge-handle-secondary-addresses.patch Content-Type: text/x-patch; name=xen-network-bridge-handle-secondary-addresses.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 " --=-6BDCUZsTRVL5AzaaQ90X Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-6BDCUZsTRVL5AzaaQ90X--