summaryrefslogtreecommitdiff
path: root/sys/net/if.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2013-11-18 09:16:31 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2013-11-18 09:16:31 +0000
commitce2fb986d5ad44761ff5d96b8e2770b7e5cd8b6a (patch)
treea765ab2473c1cbd472ec848ec7f01f1bf03cd699 /sys/net/if.c
parenta19f520db1fd453b247a9c81abe07775c4708c3e (diff)
Convert trunk(4) to use a detachhook, discussed at b2k13 with many.
While here add a comment explaining detach hooks' order of execution when destroying/detaching an interface.
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 04f0b6d389d..5a4a7998733 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.275 2013/11/11 09:15:34 mpi Exp $ */
+/* $OpenBSD: if.c,v 1.276 2013/11/18 09:16:30 mpi Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -118,10 +118,6 @@
#include <net/bpf.h>
#endif
-#if NTRUNK > 0
-#include <net/if_trunk.h>
-#endif
-
#if NBRIDGE > 0
#include <net/if_bridge.h>
#endif
@@ -511,14 +507,13 @@ if_detach(struct ifnet *ifp)
ifp->if_ioctl = if_detached_ioctl;
ifp->if_watchdog = if_detached_watchdog;
- /* Call detach hooks, ie. to remove vlan interfaces */
+ /*
+ * Call detach hooks from head to tail. To make sure detach
+ * hooks are executed in the reverse order they were added, all
+ * the hooks have to be added to the head!
+ */
dohooks(ifp->if_detachhooks, HOOK_REMOVE | HOOK_FREE);
-#if NTRUNK > 0
- if (ifp->if_type == IFT_IEEE8023ADLAG)
- trunk_port_ifdetach(ifp);
-#endif
-
#if NBRIDGE > 0
/* Remove the interface from any bridge it is part of. */
if (ifp->if_bridgeport)