tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

interface detach/destroy hook?



I'm trying to build my srt code for 3.1.

I find myself wanting to get notified when a struct ifnet is being
destroyed, to avoid using dangling pointers.  But I don't see any kind
of interface destruction hook.  Looking for other stackable interfaces,
I find bridge, vlan, and pppoe.  bridge and vlan have dedicated members
in struct ifnet, which are used at destruction time to provide custom
analogs.  And it looks to me as though pppoe stacks but has nothing to
deal with its underlying interface vanishing out from under it (for
pppoe, this is not implausible - a laptop with PCMCIA Ethernet is the
first example that comes to mind).  There is pppoe_ifattach_hook, but
that's only if PFIL_HOOKS.

Am I missing something, or is there really nothing in place to deal
generically with code that keeps struct ifnet pointers finding out when
their structs ifnet disappear?  If the latter, is this fixed in >3.1?
I don't see any srt in 4.0, and, looking at the if_srt.c in -current,
it appears that it too has no protection in this regard (not
surprising; it looks barely modified from my code, and I never wrote
any such support), so those are no help here.

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML                mouse%rodents-montreal.org@localhost
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index