diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2019-06-09 17:40:35 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2019-06-09 17:40:35 +0000 |
commit | af72230377d544577f6f07024de504a35819edc7 (patch) | |
tree | fbcc6e1a19542cfc8724335a949be4afaa5e4aaf | |
parent | 5d678bb391d3f5e77e6a589e64173f77afca15f1 (diff) |
Remove code for non-Ethernet members, these are no longer supported.
From Eygene Ryabinkin.
-rw-r--r-- | sys/net/if_bridge.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 1d178dc4d22..44f0d9cc3c1 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bridge.c,v 1.333 2019/05/13 18:14:05 mpi Exp $ */ +/* $OpenBSD: if_bridge.c,v 1.334 2019/06/09 17:40:34 mpi Exp $ */ /* * Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net) @@ -285,7 +285,10 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) error = ENOENT; break; } - + if (ifs->if_type != IFT_ETHER) { + error = EINVAL; + break; + } if (ifs->if_bridgeidx != 0) { if (ifs->if_bridgeidx == ifp->if_index) error = EEXIST; @@ -304,23 +307,18 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; } - if (ifs->if_type == IFT_ETHER) { - error = ifpromisc(ifs, 1); - if (error != 0) - break; - } else { - error = EINVAL; - break; - } - bif = malloc(sizeof(*bif), M_DEVBUF, M_NOWAIT|M_ZERO); if (bif == NULL) { - if (ifs->if_type == IFT_ETHER) - ifpromisc(ifs, 0); error = ENOMEM; break; } + error = ifpromisc(ifs, 1); + if (error != 0) { + free(bif, M_DEVBUF, sizeof(*bif)); + break; + } + bif->bridge_sc = sc; bif->ifp = ifs; bif->bif_flags = IFBIF_LEARNING | IFBIF_DISCOVER; @@ -1201,8 +1199,6 @@ bridge_process(struct ifnet *ifp, struct mbuf *m) */ bif0 = bif; SMR_SLIST_FOREACH_LOCKED(bif, &sc->sc_iflist, bif_next) { - if (bif->ifp->if_type != IFT_ETHER) - continue; if (bridge_ourether(bif->ifp, eh->ether_dhost)) { if (bif0->bif_flags & IFBIF_LEARNING) bridge_rtupdate(sc, |