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