diff options
author | Marco Pfatschbacher <mpf@cvs.openbsd.org> | 2010-10-28 19:00:58 +0000 |
---|---|---|
committer | Marco Pfatschbacher <mpf@cvs.openbsd.org> | 2010-10-28 19:00:58 +0000 |
commit | c1724a5c8ead9cf52280e953c1aaba9d0876b720 (patch) | |
tree | 30215c0285e2ea28355443c1a330c37d43084058 /sys | |
parent | 08ee3bc33ace0d40f7767fa2d72fc3e7a40b4065 (diff) |
Fix a 'bstp still active' panic that happens if a stp enabled
interface is destroyed while in the bridge. Fixed by using
bridge_delete() which includes the missing bstp_delete() call: Less
code and more consistency. Also fix SIOCBRDGDEL to return an error
if an interface can not be found.
OK claudio, markus.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if_bridge.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 85206689769..0ff14e4880a 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bridge.c,v 1.185 2010/10/28 13:49:54 claudio Exp $ */ +/* $OpenBSD: if_bridge.c,v 1.186 2010/10/28 19:00:57 mpf Exp $ */ /* * Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net) @@ -403,11 +403,10 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) if (strncmp(p->ifp->if_xname, req->ifbr_ifsname, sizeof(p->ifp->if_xname)) == 0) { error = bridge_delete(sc, p); - p = NULL; break; } } - if (p != NULL && p == LIST_END(&sc->sc_iflist)) { + if (p == LIST_END(&sc->sc_iflist)) { error = ENOENT; break; } @@ -741,11 +740,7 @@ bridge_ifdetach(struct ifnet *ifp) LIST_FOREACH(bif, &sc->sc_iflist, next) if (bif->ifp == ifp) { - LIST_REMOVE(bif, next); - bridge_rtdelete(sc, ifp, 0); - bridge_flushrule(bif); - free(bif, M_DEVBUF); - ifp->if_bridge = NULL; + bridge_delete(sc, bif); break; } } |