From 640c4fd6869a7a9cd7e410b727f32524204d55c4 Mon Sep 17 00:00:00 2001 From: Aurelien Jarno Date: Sun, 10 Jun 2012 23:18:44 +0200 Subject: [PATCH] lan9118: fix multicast filtering The lan9118 emulation tries to compute the multicast index by calling directly the crc32() function from zlib, but fails to get the correct result. Use the common compute_mcast_idx() function instead, which gives the correct result. This fixes IPv6 support. Reviewed-by: Peter Maydell Signed-off-by: Aurelien Jarno (cherry picked from commit 449bc90e1f2e2fbafb64eb0c76d16c9352b0d2df) Signed-off-by: Michael Roth --- hw/lan9118.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/lan9118.c b/hw/lan9118.c index ff0a50b..ceaf96f 100644 --- a/hw/lan9118.c +++ b/hw/lan9118.c @@ -500,7 +500,7 @@ static int lan9118_filter(lan9118_state *s, const uint8_t *addr) } } else { /* Hash matching */ - hash = (crc32(~0, addr, 6) >> 26); + hash = compute_mcast_idx(addr); if (hash & 0x20) { return (s->mac_hashh >> (hash & 0x1f)) & 1; } else {