lan9118: fix multicast filtering
authorAurelien Jarno <aurelien@aurel32.net>
Sun, 10 Jun 2012 21:18:44 +0000 (23:18 +0200)
committerAurelien Jarno <aurelien@aurel32.net>
Fri, 7 Sep 2012 15:35:34 +0000 (17:35 +0200)
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 <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
hw/lan9118.c

index ff0a50b..ceaf96f 100644 (file)
@@ -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 {