--- if_vlan.dist.c 2008-06-04 09:35:05.000000000 -0700 +++ if_vlan.c 2008-06-05 14:48:04.000000000 -0700 @@ -1062,6 +1062,8 @@ ifp->if_drv_flags |= IFF_DRV_RUNNING; done: TRUNK_UNLOCK(trunk); + if (error == 0) + EVENTHANDLER_INVOKE(vlan_config, p, ifv->ifv_tag); VLAN_UNLOCK(); return (error); @@ -1084,12 +1086,14 @@ struct ifvlantrunk *trunk; struct vlan_mc_entry *mc; struct ifvlan *ifv; + struct ifnet *parent; int error; VLAN_LOCK_ASSERT(); ifv = ifp->if_softc; trunk = ifv->ifv_trunk; + parent = PARENT(ifv); if (trunk) { struct sockaddr_dl sdl; @@ -1153,6 +1157,8 @@ ifp->if_link_state = LINK_STATE_UNKNOWN; ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + EVENTHANDLER_INVOKE(vlan_unconfig, parent, ifv->ifv_tag); + return (0); } --- eventhandler.dist.h 2008-06-05 09:24:16.000000000 -0700 +++ eventhandler.h 2008-06-05 09:27:36.000000000 -0700 @@ -175,6 +175,13 @@ typedef void (*mountroot_handler_t)(void *); EVENTHANDLER_DECLARE(mountroot, mountroot_handler_t); +/* VLAN state change events */ +struct ifnet; +typedef void (*vlan_config_fn)(void *, struct ifnet *, uint16_t); +typedef void (*vlan_unconfig_fn)(void *, struct ifnet *, uint16_t); +EVENTHANDLER_DECLARE(vlan_config, vlan_config_fn); +EVENTHANDLER_DECLARE(vlan_unconfig, vlan_unconfig_fn); + /* * Process events * process_fork and exit handlers are called without Giant.