'struct ifnet' question!

Max Laier max at love2party.net
Sun May 16 11:30:28 PDT 2004


On Friday 14 May 2004 11:38, Artis Caune wrote:
<...>
> And here is the problem:
> If i watch departure events, interface renaming feature will
> flush walid rules:
>    case SIOCSIFNAME:
>       ...
>       EVENTHANDLER_INVOKE(ifnet_departure_event, ifp);
>       ... change if_xname ...
>       EVENTHANDLER_INVOKE(ifnet_arrival_event, ifp);
>
> how about another event? ;)
>       EVENTHANDLER_INVOKE(ifnet_rename_event, ifp->ifx_name, new_name);
>       strlcpy(ifp->if_xname, new_name, sizeof(ifp->if_xname));

PLEASE NO! I can't say that I have read your implementation sketch in-depth, 
but if you need such a thing it is broken.

> > The other (big) problem in this field is, how to handle yet unknown
> > interfaces (e.g. USB/Cardbus/ppp/tun/...).
>
> What is about usb/cardbus/... interfaces? Don't they also call
> ether_ifattach()/if_attach()?

Of course they do, but you might want to write rules for those interfaces 
*before* you plug in your card so you can not use if_nametoindex.

-- 
Best regards,				| mlaier at freebsd.org
Max Laier				| ICQ #67774661
http://pf4freebsd.love2party.net/	| mlaier at EFnet


More information about the freebsd-net mailing list