diff options
author | yongari <yongari@FreeBSD.org> | 2011-03-19 22:36:59 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2011-03-19 22:36:59 +0000 |
commit | 67191b8d7ceea1ea67eff094ed3bc3050ce8b7a0 (patch) | |
tree | d87c7fa945ae4e5b90e7259b9a04d7984133d80c /sys/dev/vte | |
parent | a96a94aaf2c2c5e969e0f3d4104fd843b96c473f (diff) | |
download | FreeBSD-src-67191b8d7ceea1ea67eff094ed3bc3050ce8b7a0.zip FreeBSD-src-67191b8d7ceea1ea67eff094ed3bc3050ce8b7a0.tar.gz |
Correct broadcast frame handling. Setting bit6 of MCR0 register
enables broadcast filtering. Make sure to clear the bit to receive
broadcast frames. While I'm here rename the bit definition to
reflect reality.
Reported by: brad@OpenBSD
MFC after: 1 week
Diffstat (limited to 'sys/dev/vte')
-rw-r--r-- | sys/dev/vte/if_vte.c | 5 | ||||
-rw-r--r-- | sys/dev/vte/if_vtereg.h | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/vte/if_vte.c b/sys/dev/vte/if_vte.c index 63c751a..5dec0f4 100644 --- a/sys/dev/vte/if_vte.c +++ b/sys/dev/vte/if_vte.c @@ -1963,9 +1963,10 @@ vte_rxfilter(struct vte_softc *sc) } mcr = CSR_READ_2(sc, VTE_MCR0); - mcr &= ~(MCR0_PROMISC | MCR0_BROADCAST | MCR0_MULTICAST); + mcr &= ~(MCR0_PROMISC | MCR0_MULTICAST); + mcr |= MCR0_BROADCAST_DIS; if ((ifp->if_flags & IFF_BROADCAST) != 0) - mcr |= MCR0_BROADCAST; + mcr &= ~MCR0_BROADCAST_DIS; if ((ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) != 0) { if ((ifp->if_flags & IFF_PROMISC) != 0) mcr |= MCR0_PROMISC; diff --git a/sys/dev/vte/if_vtereg.h b/sys/dev/vte/if_vtereg.h index 0c4b19f..536617b 100644 --- a/sys/dev/vte/if_vtereg.h +++ b/sys/dev/vte/if_vtereg.h @@ -48,7 +48,7 @@ #define MCR0_ACCPT_LONG_PKT 0x0008 #define MCR0_ACCPT_DRIBBLE 0x0010 #define MCR0_PROMISC 0x0020 -#define MCR0_BROADCAST 0x0040 +#define MCR0_BROADCAST_DIS 0x0040 #define MCR0_RX_EARLY_INTR 0x0080 #define MCR0_MULTICAST 0x0100 #define MCR0_FC_ENB 0x0200 |