summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-08-08 18:53:11 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-08-08 18:53:11 +0000
commit7523475543ac033d44426cc3af0dbf3f0422a0dc (patch)
treefbb080c1abbb630c0fbee934608a193880b4e265 /sys/dev
parent3ab565ae63338bb08ec083b022f2841b1a22728c (diff)
Fix IFF_PROMISC setting optimization. The point is to avoid the
wi_init() if only IFF_PROMISC status has changed. There is no need to change anything if we are in HostAP mode since wi_init() has already turned off the hardware promisc bit when we entered HostAP (HostAP already implies promisc behavior). Noticed by imp@, OK by mickey@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/if_wi.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/sys/dev/ic/if_wi.c b/sys/dev/ic/if_wi.c
index 61cfdaec71a..d9658bf96e1 100644
--- a/sys/dev/ic/if_wi.c
+++ b/sys/dev/ic/if_wi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi.c,v 1.75 2002/07/16 13:46:43 fgsch Exp $ */
+/* $OpenBSD: if_wi.c,v 1.76 2002/08/08 18:53:10 millert Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -124,7 +124,7 @@ u_int32_t widebug = WIDEBUG;
#if !defined(lint) && !defined(__OpenBSD__)
static const char rcsid[] =
- "$OpenBSD: if_wi.c,v 1.75 2002/07/16 13:46:43 fgsch Exp $";
+ "$OpenBSD: if_wi.c,v 1.76 2002/08/08 18:53:10 millert Exp $";
#endif /* lint */
#ifdef foo
@@ -1466,20 +1466,18 @@ wi_ioctl(ifp, command, data)
case SIOCSIFFLAGS:
if (ifp->if_flags & IFF_UP) {
- if (sc->wi_ptype == WI_PORTTYPE_AP) {
- WI_SETVAL(WI_RID_PROMISC, 0);
- } else {
- if (ifp->if_flags & IFF_RUNNING &&
- ifp->if_flags & IFF_PROMISC &&
- !(sc->wi_if_flags & IFF_PROMISC)) {
+ if (ifp->if_flags & IFF_RUNNING &&
+ ifp->if_flags & IFF_PROMISC &&
+ !(sc->wi_if_flags & IFF_PROMISC)) {
+ if (sc->wi_ptype != WI_PORTTYPE_AP)
WI_SETVAL(WI_RID_PROMISC, 1);
- } else if (ifp->if_flags & IFF_RUNNING &&
- !(ifp->if_flags & IFF_PROMISC) &&
- sc->wi_if_flags & IFF_PROMISC) {
+ } else if (ifp->if_flags & IFF_RUNNING &&
+ !(ifp->if_flags & IFF_PROMISC) &&
+ sc->wi_if_flags & IFF_PROMISC) {
+ if (sc->wi_ptype != WI_PORTTYPE_AP)
WI_SETVAL(WI_RID_PROMISC, 0);
- }
- }
- wi_init(sc);
+ } else
+ wi_init(sc);
} else if (ifp->if_flags & IFF_RUNNING)
wi_stop(sc);
sc->wi_if_flags = ifp->if_flags;