WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] network-bridge: Fix do_ifup in the case of ${bridge}

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] network-bridge: Fix do_ifup in the case of ${bridge} != ${netdev}
From: "KUWAMURA Shin'ya" <kuwa@xxxxxxxxxxxxxx>
Date: Thu, 02 Apr 2009 10:55:39 +0900 (JST)
Delivery-date: Wed, 01 Apr 2009 18:57:00 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi,

On RHEL5.2, ifup ${bridge} fails if ${bridge} != ${netdev},
because RHEL5.2's ifup ${bridge} runs the following sequence:

1. Search CONFIG that has the same mac address of ${bridge}. 
   ifcfg-${netdev} is found.
2. Run "ip link set dev ${netdev} up".
   # ${bridge} is expected.
3. Output "Failed to bring up ${netdev}."
   Because ${netdev} does not exist.

Thus, do_ifup() should not use ifup if ${bridge} != ${netdev}.

Signed-off-by: KUWAMURA Shin'ya <kuwa@xxxxxxxxxxxxxx>

Best regards,
-- 
  KUWAMURA Shin'ya
# HG changeset patch
# User KUWAMURA Shin'ya <kuwa@xxxxxxxxxxxxxx>
# Date 1238636723 -32400
# Node ID f0629bafed6e6fab07663d55aeb5ed6e63d44987
# Parent  d5ddc782bc499a3605417eeef519b33616402768
network-bridge: Fix do_ifup in the case of ${bridge} != ${netdev}

On RHEL5.2, ifup ${bridge} fails if ${bridge} != ${netdev}.
do_ifup() does not use ifup if ${bridge} != ${netdev}.

Signed-off-by: KUWAMURA Shin'ya <kuwa@xxxxxxxxxxxxxx>

diff -r d5ddc782bc49 -r f0629bafed6e tools/hotplug/Linux/network-bridge
--- a/tools/hotplug/Linux/network-bridge        Mon Mar 30 16:48:26 2009 +0100
+++ b/tools/hotplug/Linux/network-bridge        Thu Apr 02 10:45:23 2009 +0900
@@ -106,7 +106,7 @@ get_ip_info() {
 }
     
 do_ifup() {
-    if ! ifup $1 ; then
+    if [ $1 != "${netdev}" ] || ! ifup $1 ; then
         if [ -n "$addr_pfx" ] ; then
             # use the info from get_ip_info()
             ip addr flush $1
@@ -223,9 +223,9 @@ op_start () {
 
     preiftransfer ${netdev}
     transfer_addrs ${netdev} ${tdev}
+    # Remember the IP details for do_ifup.
+    get_ip_info ${netdev}
     if ! ifdown ${netdev}; then
-       # If ifdown fails, remember the IP details.
-       get_ip_info ${netdev}
        ip link set ${netdev} down
        ip addr flush ${netdev}
     fi
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] network-bridge: Fix do_ifup in the case of ${bridge} != ${netdev}, KUWAMURA Shin'ya <=