summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_bge.c
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2006-02-06 04:59:31 +0000
committerBrad Smith <brad@cvs.openbsd.org>2006-02-06 04:59:31 +0000
commit512f49d0550ed85febcbc53bc357720463f8bf1f (patch)
tree2a3edda72c83b340abc50ee6e3b8c1e69aaf3769 /sys/dev/pci/if_bge.c
parent67bac06bada195b083468e2548dd6368be09424a (diff)
Make sure to call bge_setmulti() as we're enabling or disabling promiscuous
mode so as to receive all multicast packets too.
Diffstat (limited to 'sys/dev/pci/if_bge.c')
-rw-r--r--sys/dev/pci/if_bge.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c
index 6687efc08d1..0c933218e0e 100644
--- a/sys/dev/pci/if_bge.c
+++ b/sys/dev/pci/if_bge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bge.c,v 1.127 2006/02/02 21:31:10 brad Exp $ */
+/* $OpenBSD: if_bge.c,v 1.128 2006/02/06 04:59:30 brad Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -1101,8 +1101,8 @@ bge_setmulti(struct bge_softc *sc)
CSR_WRITE_4(sc, BGE_MAR0 + (i * 4), 0);
/* Now program new ones. */
-allmulti:
if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) {
+allmulti:
for (i = 0; i < 4; i++)
CSR_WRITE_4(sc, BGE_MAR0 + (i * 4), 0xFFFFFFFF);
return;
@@ -3138,15 +3138,14 @@ bge_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
switch(command) {
case SIOCSIFADDR:
ifp->if_flags |= IFF_UP;
+ bge_init(sc);
switch (ifa->ifa_addr->sa_family) {
#ifdef INET
case AF_INET:
- bge_init(sc);
arp_ifinit(&sc->arpcom, ifa);
break;
#endif /* INET */
default:
- bge_init(sc);
break;
}
break;
@@ -3173,25 +3172,23 @@ bge_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
!(sc->bge_if_flags & IFF_PROMISC)) {
BGE_SETBIT(sc, BGE_RX_MODE,
BGE_RXMODE_RX_PROMISC);
+ bge_setmulti(sc);
} else if (ifp->if_flags & IFF_RUNNING &&
!(ifp->if_flags & IFF_PROMISC) &&
sc->bge_if_flags & IFF_PROMISC) {
BGE_CLRBIT(sc, BGE_RX_MODE,
BGE_RXMODE_RX_PROMISC);
+ bge_setmulti(sc);
} else if (ifp->if_flags & IFF_RUNNING &&
- (ifp->if_flags ^ sc->bge_if_flags) & IFF_ALLMULTI) {
+ (ifp->if_flags ^ sc->bge_if_flags) & IFF_ALLMULTI)
bge_setmulti(sc);
- } else {
- ifp->if_flags &= ~IFF_RUNNING;
+ else
bge_init(sc);
- }
} else {
- if (ifp->if_flags & IFF_RUNNING) {
+ if (ifp->if_flags & IFF_RUNNING)
bge_stop(sc);
- }
}
sc->bge_if_flags = ifp->if_flags;
- error = 0;
break;
case SIOCADDMULTI:
case SIOCDELMULTI: