diff options
author | glebius <glebius@FreeBSD.org> | 2005-02-14 12:01:09 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2005-02-14 12:01:09 +0000 |
commit | 38b3e66d0e482dcdfa25e3a105ecf1953564ffcc (patch) | |
tree | 94c23046d989fd4910b204ad35b0062aeb4759d1 /sys/netgraph/ng_ether.c | |
parent | db16f02fe3ae580aab2242ba7ca6506161ec5408 (diff) | |
download | FreeBSD-src-38b3e66d0e482dcdfa25e3a105ecf1953564ffcc.zip FreeBSD-src-38b3e66d0e482dcdfa25e3a105ecf1953564ffcc.tar.gz |
Add new netgraph control message NGM_ETHER_DETACH, which actually
removes netgraph node and unwraps Ethernet interface.
This gives us ability to unload ng_ether.ko, when all interfaces
are detached, making ng_ether(4) developers happy.
Reviewed by: ru
Diffstat (limited to 'sys/netgraph/ng_ether.c')
-rw-r--r-- | sys/netgraph/ng_ether.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/netgraph/ng_ether.c b/sys/netgraph/ng_ether.c index 30acdfa..f5dc793 100644 --- a/sys/netgraph/ng_ether.c +++ b/sys/netgraph/ng_ether.c @@ -186,6 +186,13 @@ static const struct ng_cmdlist ng_ether_cmdlist[] = { &ng_parse_enaddr_type, NULL }, + { + NGM_ETHER_COOKIE, + NGM_ETHER_DETACH, + "detach", + NULL, + NULL + }, { 0 } }; @@ -544,6 +551,9 @@ ng_ether_rcvmsg(node_p node, item_p item, hook_p lasthook) (struct sockaddr *)&sa_dl); break; } + case NGM_ETHER_DETACH: + ng_ether_detach(priv->ifp); + break; default: error = EINVAL; break; |