summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoritojun <itojun@openbsd.org>2002-07-08 14:48:57 +0000
committeritojun <itojun@openbsd.org>2002-07-08 14:48:57 +0000
commit11ba8729bc1279b79872631093cf043de57a89a2 (patch)
treea8934e29004ab288ee534ae4b3c1a6b47d71a2b6
parentDon't allow 'flags' option in non-TCP rules, found by mpech@ (diff)
downloadwireguard-openbsd-11ba8729bc1279b79872631093cf043de57a89a2.tar.xz
wireguard-openbsd-11ba8729bc1279b79872631093cf043de57a89a2.zip
tl* multicast filter is broken. use ALLMULTI for now.
-rw-r--r--sys/dev/pci/if_tl.c53
1 files changed, 27 insertions, 26 deletions
diff --git a/sys/dev/pci/if_tl.c b/sys/dev/pci/if_tl.c
index 47cc15f5618..dba8b329874 100644
--- a/sys/dev/pci/if_tl.c
+++ b/sys/dev/pci/if_tl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_tl.c,v 1.27 2002/07/05 13:48:11 aaron Exp $ */
+/* $OpenBSD: if_tl.c,v 1.28 2002/07/08 14:48:57 itojun Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -860,42 +860,43 @@ void tl_setmulti(sc)
{
struct ifnet *ifp;
u_int32_t hashes[2] = { 0, 0 };
- int h, i;
+ int h;
struct arpcom *ac = &sc->arpcom;
struct ether_multistep step;
struct ether_multi *enm;
- u_int8_t dummy[] = { 0, 0, 0, 0, 0 ,0 };
ifp = &sc->arpcom.ac_if;
- /* First, zot all the existing filters. */
- for (i = 1; i < 4; i++)
- tl_setfilt(sc, (caddr_t)&dummy, i);
tl_dio_write32(sc, TL_HASH1, 0);
tl_dio_write32(sc, TL_HASH2, 0);
- /* Now program new ones. */
- if (ifp->if_flags & IFF_ALLMULTI) {
- hashes[0] = 0xFFFFFFFF;
- hashes[1] = 0xFFFFFFFF;
- } else {
- i = 1;
- ETHER_FIRST_MULTI(step, ac, enm);
- while (enm != NULL) {
- if (i < 4) {
- tl_setfilt(sc, enm->enm_addrlo, i);
- i++;
- continue;
- }
-
+ ifp->if_flags &= ~IFF_ALLMULTI;
+#if 0
+ ETHER_FIRST_MULTI(step, ac, enm);
+ while (enm != NULL) {
+ if (memcmp(enm->enm_addrlo, enm->enm_addrhi, 6) == 0) {
h = tl_calchash(enm->enm_addrlo);
- if (h < 32)
- hashes[0] |= (1 << h);
- else
- hashes[1] |= (1 << (h - 32));
-
- ETHER_NEXT_MULTI(step, enm);
+ hashes[h/32] |= (1 << (h % 32));
+ } else {
+ hashes[0] = hashes[1] = 0xffffffff;
+ ifp->if_flags |= IFF_ALLMULTI;
+ break;
}
+ ETHER_NEXT_MULTI(step, enm);
}
+#else
+ ETHER_FIRST_MULTI(step, ac, enm);
+ h = 0;
+ while (enm != NULL) {
+ h++;
+ ETHER_NEXT_MULTI(step, enm);
+ }
+ if (h) {
+ hashes[0] = hashes[1] = 0xffffffff;
+ ifp->if_flags |= IFF_ALLMULTI;
+ } else {
+ hashes[0] = hashes[1] = 0x00000000;
+ }
+#endif
tl_dio_write32(sc, TL_HASH1, hashes[0]);
tl_dio_write32(sc, TL_HASH2, hashes[1]);