OpenVZ Forum


Home » Mailing lists » Devel » [patch 0/1] fix veth netif_carrier_off
Re: [patch 1/1] fix bad netif_carrier_off place [message #20500 is a reply to message #20479] Wed, 19 September 2007 08:35 Go to previous message
Pavel Emelianov is currently offline  Pavel Emelianov
Messages: 1149
Registered: September 2006
Senior Member
> From: Daniel Lezcano <dlezcano@fr.ibm.com>
> 
> If the netif_carrier_off is called before register_netdev
> that will use and generate an event for a non initialized network
> device and that leads to a Oops.
> 
> I moved the netif_carrier_off from the setup function after each 
> register_netdev call.
> 
> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>

Acked-by: Pavel Emelyanov <xemul@openvz.org>

Eric, if you managed to reproduce your oopses, does this patch help?

BTW, this problem exists for some other drivers, no? E.g.
xpnet_init() does the same thing and probably oopses as well.

> ---
>  drivers/net/veth.c |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> Index: net-2.6.24/drivers/net/veth.c
> ===================================================================
> --- net-2.6.24.orig/drivers/net/veth.c
> +++ net-2.6.24/drivers/net/veth.c
> @@ -286,7 +286,6 @@ static void veth_setup(struct net_device
>  	dev->features |= NETIF_F_LLTX;
>  	dev->init = veth_dev_init;
>  	dev->destructor = veth_dev_free;
> -	netif_carrier_off(dev);
>  }
>  
>  /*
> @@ -357,6 +356,8 @@ static int veth_newlink(struct net_devic
>  	if (err < 0)
>  		goto err_register_peer;
>  
> +	netif_carrier_off(peer);
> +
>  	/*
>  	 * register dev last
>  	 *
> @@ -382,6 +383,8 @@ static int veth_newlink(struct net_devic
>  	if (err < 0)
>  		goto err_register_dev;
>  
> +	netif_carrier_off(dev);
> +
>  	/*
>  	 * tie the deviced together
>  	 */
> 
> -- 


_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
 
Read Message
Read Message
Read Message
Previous Topic: [PATCH][NETNS] Cleanup list walking in setup_net and cleanup_net
Next Topic: [PATCH] return correct error code from child_rip in x86_64 entry.S
Goto Forum:
  


Current Time: Sat Aug 30 10:49:00 GMT 2025

Total time taken to generate the page: 0.08653 seconds