From f6293051c9bcfc333ae61c575230e2f23c6390d3 Mon Sep 17 00:00:00 2001 From: thompsa Date: Thu, 1 Jun 2006 00:41:07 +0000 Subject: Announce all interfaces to devd on attach/detach. This adds a new devctl notification so all interfaces including pseudo are reported. When netif creates the clones at startup devctl_disable has not been turned off yet so the interfaces will not be initialised twice, enforce this by adding an explicit order between rc.d/netif and rc.d/devd. This change allows actions to taken in userland when an interface is cloned and the pseudo interface will be automatically configured if a ifconfig_="" line exists in rc.conf. Reviewed by: brooks No objections on: net --- sys/net/if.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sys/net/if.c') diff --git a/sys/net/if.c b/sys/net/if.c index 03b21ca..a3c02bb 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -505,6 +505,7 @@ if_attach(struct ifnet *ifp) if_attachdomain1(ifp); EVENTHANDLER_INVOKE(ifnet_arrival_event, ifp); + devctl_notify("IFNET", ifp->if_xname, "ATTACH", NULL); /* Announce the interface. */ rt_ifannouncemsg(ifp, IFAN_ARRIVAL); @@ -682,6 +683,7 @@ if_detach(struct ifnet *ifp) /* Announce that the interface is gone. */ rt_ifannouncemsg(ifp, IFAN_DEPARTURE); EVENTHANDLER_INVOKE(ifnet_departure_event, ifp); + devctl_notify("IFNET", ifp->if_xname, "DETACH", NULL); IF_AFDATA_LOCK(ifp); for (dp = domains; dp; dp = dp->dom_next) { -- cgit v1.1