diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1999-08-08 00:43:01 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1999-08-08 00:43:01 +0000 |
commit | e09cf6c78cf6abfe9238df036609a770d07895c7 (patch) | |
tree | 0372b157616721e3317d539fd56a6afe5e270c6a /sys/net/if_bridge.c | |
parent | 8caf3f08d55dcea309e251d36eca66a7159efe22 (diff) |
Support detaching of network interfaces. Still work to do in ipf, and
other families than inet.
Diffstat (limited to 'sys/net/if_bridge.c')
-rw-r--r-- | sys/net/if_bridge.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 5e854683c5c..1a870eddb45 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bridge.c,v 1.12 1999/07/24 19:11:13 jason Exp $ */ +/* $OpenBSD: if_bridge.c,v 1.13 1999/08/08 00:43:00 niklas Exp $ */ /* * Copyright (c) 1999 Jason L. Wright (jason@thought.net) @@ -442,6 +442,24 @@ bridge_ioctl(ifp, cmd, data) return (error); } +/* Detach an interface from a bridge. */ +void +bridge_ifdetach(ifp) + struct ifnet *ifp; +{ + struct bridge_softc *bsc = (struct bridge_softc *)ifp->if_bridge; + struct bridge_iflist *bif; + + for (bif = LIST_FIRST(&bsc->sc_iflist); bif; + bif = LIST_NEXT(bif, next)) + if (bif->ifp == ifp) { + LIST_REMOVE(bif, next); + bridge_rtdelete(bsc, ifp); + free(bif, M_DEVBUF); + break; + } +} + int bridge_bifconf(sc, bifc) struct bridge_softc *sc; |