diff options
author | 2009-06-03 05:55:15 +0000 | |
---|---|---|
committer | 2009-06-03 05:55:15 +0000 | |
commit | 044a7838a1622e91e3ef5df2557f4931f7fe4070 (patch) | |
tree | a332d01382b554d234288d3ab3e20fb41c904fcf /sys/dev/pci/if_bge.c | |
parent | change buf_close return type to void. (diff) | |
download | wireguard-openbsd-044a7838a1622e91e3ef5df2557f4931f7fe4070.tar.xz wireguard-openbsd-044a7838a1622e91e3ef5df2557f4931f7fe4070.zip |
set IFF_ALLMULTI properly also when in promiscuous mode and some
cosmetic tweaking; from Brad
Diffstat (limited to 'sys/dev/pci/if_bge.c')
-rw-r--r-- | sys/dev/pci/if_bge.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c index 0cffcecd381..90aba697882 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.267 2009/06/03 05:19:21 naddy Exp $ */ +/* $OpenBSD: if_bge.c,v 1.268 2009/06/03 05:55:15 naddy Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -1192,23 +1192,25 @@ bge_iff(struct bge_softc *sc) ifp->if_flags &= ~IFF_ALLMULTI; memset(hashes, 0x00, sizeof(hashes)); - if (ifp->if_flags & IFF_PROMISC) + if (ifp->if_flags & IFF_PROMISC) { + ifp->if_flags |= IFF_ALLMULTI; rxmode |= BGE_RXMODE_RX_PROMISC; - else if (ac->ac_multirangecnt > 0) { + } else if (ac->ac_multirangecnt > 0) { ifp->if_flags |= IFF_ALLMULTI; memset(hashes, 0xff, sizeof(hashes)); } else { ETHER_FIRST_MULTI(step, ac, enm); while (enm != NULL) { h = ether_crc32_le(enm->enm_addrlo, ETHER_ADDR_LEN); + setbit(hashes, h & 0x7F); + ETHER_NEXT_MULTI(step, enm); } } bus_space_write_raw_region_4(sc->bge_btag, sc->bge_bhandle, BGE_MAR0, hashes, sizeof(hashes)); - CSR_WRITE_4(sc, BGE_RX_MODE, rxmode); } |