summaryrefslogtreecommitdiff
path: root/sys/net/if_bridge.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2017-11-20 10:17:41 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2017-11-20 10:17:41 +0000
commit5da939dc8afafa50ffbd55badab9d9a6c8dab59f (patch)
tree15175d30fed6ab43f514a364975293ed20840689 /sys/net/if_bridge.c
parentdb9b6ebfba02785b116e4ac1c7fcabe9e41ed204 (diff)
Remove duplicated code working around the fact that ifpromisc() required
a DOWN interface. ok visa@
Diffstat (limited to 'sys/net/if_bridge.c')
-rw-r--r--sys/net/if_bridge.c40
1 files changed, 4 insertions, 36 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index 64e5a7f57dc..5a734c9d65f 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bridge.c,v 1.298 2017/08/17 10:14:08 mikeb Exp $ */
+/* $OpenBSD: if_bridge.c,v 1.299 2017/11/20 10:17:40 mpi Exp $ */
/*
* Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net)
@@ -299,41 +299,9 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
}
if (ifs->if_type == IFT_ETHER) {
- if ((ifs->if_flags & IFF_UP) == 0) {
- struct ifreq ifreq;
-
- /*
- * Bring interface up long enough to set
- * promiscuous flag, then shut it down again.
- */
- strlcpy(ifreq.ifr_name, req->ifbr_ifsname,
- IFNAMSIZ);
- ifs->if_flags |= IFF_UP;
- ifreq.ifr_flags = ifs->if_flags;
- error = (*ifs->if_ioctl)(ifs, SIOCSIFFLAGS,
- (caddr_t)&ifreq);
- if (error != 0)
- break;
-
- error = ifpromisc(ifs, 1);
- if (error != 0)
- break;
-
- strlcpy(ifreq.ifr_name, req->ifbr_ifsname,
- IFNAMSIZ);
- ifs->if_flags &= ~IFF_UP;
- ifreq.ifr_flags = ifs->if_flags;
- error = (*ifs->if_ioctl)(ifs, SIOCSIFFLAGS,
- (caddr_t)&ifreq);
- if (error != 0) {
- ifpromisc(ifs, 0);
- break;
- }
- } else {
- error = ifpromisc(ifs, 1);
- if (error != 0)
- break;
- }
+ error = ifpromisc(ifs, 1);
+ if (error != 0)
+ break;
}
#if NMPW > 0
else if (ifs->if_type == IFT_MPLSTUNNEL) {