Linux.com

Home Linux Community Forums Hardware Networking Issue with unregister & registering same netdev without doing free netdev

Issue with unregister & registering same netdev without doing free netdev

Link to this post 16 Nov 11

Hi Guys,
I have some requirement in driver in which do below operation but facing some bug_on from kernel
-> Depending on application input i have to unregister & register the same netdev without freeing
I am facing the bug_on from kernel during registration as below
BUG_ON(dev->reg_state != NETREG_UNINITIALIZED);

-> If we forcefully reset the state in our driver, then this works fine but kernel warns already registered device & some thing seriously wrong here

Then i have tried to initialize the device after unregistration by calling ether_setup & then again registering BUT same bug_on appeared.

My requirement is quiet simple,
-> Whenever user application want to "delete the netdev interface" then i have to make the interface disappeared for ifconfig/iwconfig, so that user can't play with that
-> Whenever user application want to "Add the netdev interface" then i have to make the interface appearing for ifconfig/iwconfig, so that user can use those

The problem is i don't want to call Alloc_netdev/free_netdev based on application input (dynamically creating/destroying), i just want to register/unregister statically created interfaces accordingly.

If you guys have any idea on this then please reply. Thanks in advance

Thanks,
Manoj


Link to this post 21 Dec 11

May I know which version of kernel so that I may give you a tip about the same ?

Link to this post 21 Dec 11

I am using ubuntu-9.10 with kernel version 2.6.31-14. In other kernel versions also (2.6.32.X) i saw the same.

Link to this post 28 Mar 12

Hi Manoj,
Have you found any solution to your problem? I am also facing exactly same problem. Please let me know.

Thanks,
Ankita

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board