DragonFlyBSD Kernel Audit
DF-2339 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/bus/u4b/net/if_cue.c b/sys/bus/u4b/net/if_cue.c
--- a/sys/bus/u4b/net/if_cue.c
+++ b/sys/bus/u4b/net/if_cue.c
@@ -270,7 +270,9 @@
 	return (uether_do_request(&sc->sc_ue, &req, buf, 1000));
 }
 
-#define	CUE_BITS 9
+#define	CUE_BITS		9
+/* CATC EL1210A has a 512-bit (64-byte) multicast hash table. */
+#define	CUE_HASH_TABLE_LEN	64
 
 static uint32_t
 cue_mchash(const uint8_t *addr)
@@ -308,15 +310,15 @@
 	struct ifnet *ifp = uether_getifp(ue);
 	struct ifmultiaddr *ifma;
 	uint32_t h = 0, i;
-	uint8_t hashtbl[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
+	uint8_t hashtbl[CUE_HASH_TABLE_LEN];
 
 	CUE_LOCK_ASSERT(sc);
 
 	if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) {
-		for (i = 0; i < 8; i++)
+		for (i = 0; i < CUE_HASH_TABLE_LEN; i++)
 			hashtbl[i] = 0xff;
 		cue_mem(sc, CUE_CMD_WRITESRAM, CUE_MCAST_TABLE_ADDR,
-		    &hashtbl, 8);
+		    &hashtbl, CUE_HASH_TABLE_LEN);
 		return;
 	}
 
@@ -338,7 +340,8 @@
 		hashtbl[h >> 3] |= 1 << (h & 0x7);
 	}
 
-	cue_mem(sc, CUE_CMD_WRITESRAM, CUE_MCAST_TABLE_ADDR, &hashtbl, 8);
+	cue_mem(sc, CUE_CMD_WRITESRAM, CUE_MCAST_TABLE_ADDR,
+	    &hashtbl, CUE_HASH_TABLE_LEN);
 }
 
 static void