On Sun, 2005-04-09 at 20:20 +0200, Patrick McHardy wrote: > jamal wrote:
> > There is no need to check for NULL; if you got that far dev cannot be > > NULL (refer to the first check for parm->ifindex). The device could not > > have disapeared since we are protected by rtnl semaphore. > > It doesn't check for the new device, it checks whether an old device if > needs to be released. This can't be done unconditionally since dev_put > doesn't handle NULL pointers. > I am not sure i followed 100% what you said but i will take your word for it. > > You are right - did you mean NETDEV_UNREGISTER notification only, > > correct? > > Correct. [..] > How do you propose to react? Kill the action or set the device > to NULL and handle it in tcf_mirred()? The setting to NULL and handle in tcf_mirred() seems simpler but would require we put extra checks in tcf_mirred() - which is the fast path ... Unless you can somehow squeeze it into that "if (!(dev->flags&IFF_UP) ) {" check ... The "RightThing(tm)" would be to walk all instances of mirred and nuke them right away if they are pointing to devices that dont exist - this would be analogous behavior to the way fib routes are forced out if next hop device disappears etc. But this would be tricky since there may be a different device pointing to a mirred action in its list of actions and nuking mirred would mean trouble. So my thinking is: Whatever you find to be easy - any solution would be better than nothing thats in there at the moment. cheers, jamal - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html