(unknown)

From: Madhvapathi Sriram <hidden>
Date: 2011-11-18 12:18:51

Hi,

In register_netdevice(), BUG_ON(dev->reg_state != NETREG_UNINITIALIZED) is
used to check if the device that is being registered is indeed a new one.

However, I see that this state is never moved to. It only happens when a
netdevice is allocated (by default to 0 using kzalloc).

So, the cycle register-->unregister-->register would fail since in the
unregister_netdevice the state is only moved to NETREG_UNREGISTERED (at max
to NETREG_RELEASED using free_netdev)

So, I presume that to reinitialize a netdevice one has to free the
netdevice, re allocate netdevice and only then re register.

Wondering why unregister and reregister is not allowed, rather than having
go through the free/alloc cycle - I am not an expert though.

Thanks
-Sriram
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help