diff options
author | archie <archie@FreeBSD.org> | 2000-06-26 23:34:54 +0000 |
---|---|---|
committer | archie <archie@FreeBSD.org> | 2000-06-26 23:34:54 +0000 |
commit | 9af816e94656f88812336df4be5d2ddac233080f (patch) | |
tree | 3c138021e860caf3702977959a7cf77c2d4eb2e3 /sys/net/if.c | |
parent | 9b2c6ebcad4b7500a4fb6f89dcd04a814bc3e7ac (diff) | |
download | FreeBSD-src-9af816e94656f88812336df4be5d2ddac233080f.zip FreeBSD-src-9af816e94656f88812336df4be5d2ddac233080f.tar.gz |
Make the ng_ether(4) node type dynamically loadable like the rest.
This means 'options NETGRAPH' is no longer necessary in order to get
netgraph-enabled Ethernet interfaces. This supports loading/unloading
the ng_ether.ko and attaching/detaching the Ethernet interface in any
order.
Add two new hooks 'upper' and 'lower' to allow access to the protocol
demux engine and the raw device, respectively. This enables bridging
to be defined as a netgraph node, if so desired.
Reviewed by: freebsd-net@freebsd.org
Diffstat (limited to 'sys/net/if.c')
-rw-r--r-- | sys/net/if.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 2dce111..e33e86c 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -54,6 +54,7 @@ #include <net/if.h> #include <net/if_arp.h> #include <net/if_dl.h> +#include <net/if_types.h> #include <net/radix.h> #include <net/route.h> @@ -236,6 +237,17 @@ if_detach(ifp) if_down(ifp); /* + * Do any type-specific detach operation + */ + switch (ifp->if_type) { + case IFT_ETHER: + ether_ifdetach(ifp); + break; + default: + break; + } + + /* * Remove address from ifnet_addrs[] and maybe decrement if_index. * Clean up all addresses. */ |