[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [patch] netfront: unregister net device at backend_changed() if network_connect() failed



Subject: netfront: unregister net device at backend_changed() if 
network_connect() failed
From: Joe Jin <joe.jin@xxxxxxxxxx>

When network_connect() failed on backend_changed(), need to call 
unregister_netdev() to unregister the device, otherwise at vm maybe create
a no-mac address net device, the device sometime might confuse user.

Signed-off-by: Joe Jin <joe.jin@xxxxxxxxxx>
---
 netfront.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff -r 2fb13b8cbe13 drivers/xen/netfront/netfront.c
--- a/drivers/xen/netfront/netfront.c   Thu Oct 30 13:34:43 2008 +0000
+++ b/drivers/xen/netfront/netfront.c   Tue Nov 18 13:52:34 2008 +0800
@@ -549,8 +549,10 @@
        case XenbusStateInitWait:
                if (dev->state != XenbusStateInitialising)
                        break;
-               if (network_connect(netdev) != 0)
+               if (network_connect(netdev) != 0) {
+                       unregister_netdev(netdev);
                        break;
+               }
                xenbus_switch_state(dev, XenbusStateConnected);
                send_fake_arp(netdev);
                break;




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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.