Julian Elischer writes:
> > i was working on integration of Ethernet TAP driver and NETGRAPH
> > and found strange thing. the problem is that NG_ETHER nodes do not
> > detach correctly when interface is gone. i was taking a very quick
> > look at it, and, it seems to me that we are missing one reference
> > to a node. i think it is ng_name_node/ng_unname pair.
> This is quite possible because until recently interfaces could never
> be removed. Therefore the act of removing a node was really
> just a case of RESETTING the node. It was not removed.
Here's some more info that may be helpful.
First of all, until yesterday, if you detach an ethernet interface
that was using netgraph you'd get a kernel panic (or somesuch) --
it was simply broken. This change will be MFC'd soon but it hasn't
yet so we're talking -current only at this point.
Now, it all should work as designed... where "as designed" means:
1. Ethernet nodes appear for each Ethernet interface at the first moment
when the following conditions *both* become true:
(a) ng_ether.ko KLD is loaded (or kernel has options NETGRAPH_ETHER)
(b) The interface is attached (e.g., at boot time, or when the
PCCARD or USB device is connected).
2. Ethernet nodes disappear when/if the interface is detached
(e.g., you pop out your Ethernet PCCARD).
3. Telling an Ethernet node to shutdown (e.g., "ngctl kill fxp0:")
simply *resets* the node, i.e., breaks all connections to other
nodes. The node does NOT go away until #2 happens.
4. You cannot kldunload ng_ether.ko until all Ethernet nodes
are detached (for obvious reasons, considering #1 and #2).
If you are seeing other behavior that this using -current sources,
please let me know, as there is a BUG.
OTOH, if you think the behavior "as designed" is incorrect, let's discuss.
Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message