NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/51167: alc(4) promiscuous mode is broken



>Number:         51167
>Category:       kern
>Synopsis:       alc(4) promiscuous mode is broken
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed May 25 17:20:00 +0000 2016
>Originator:     coypu
>Release:        NetBSD 7.99.29
>Organization:
>Environment:
NetBSD net.Home 7.99.29 NetBSD 7.99.29 (GENERIC) #2: Wed May 25 20:00:55 IDT 2016  fly%net.Home@localhost:/usr/obj/sys/arch/amd64/compile/GENERIC amd64
>Description:
connected to the internet with alc0
alc0 at pci7 dev 0 function 0: Killer E2200 Gigabit Ethernet

ping 4.2.2.1

then:
# tcpdump -i alc0 -s 0 -vvv -n

I get many messages like this:

20:02:49.603993 IP (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto ICMP (1), length 56)
    127.0.0.1 > 10.0.0.138: ICMP redirect 10.0.0.1 to host 10.0.0.1, length 36
        IP (tos 0x0, ttl 54, id 0, offset 0, flags [none], proto UDP (17), length 576, bad cksum 0 (->6e23)!)
    10.0.0.138.67 > 10.0.0.1.68:  [|bootp]
20:02:49.604000 IP (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto ICMP (1), length 56)
    127.0.0.1 > 10.0.0.138: ICMP redirect 10.0.0.1 to host 10.0.0.1, length 36
        IP (tos 0x0, ttl 53, id 0, offset 0, flags [none], proto UDP (17), length 576, bad cksum 0 (->6f23)!)
    10.0.0.138.67 > 10.0.0.1.68:  [|bootp]


>How-To-Repeat:

>Fix:
with the following patch applied, I am able to use my network normally and not reproduce the above problem:

---
 sys/dev/pci/if_alc.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/sys/dev/pci/if_alc.c b/sys/dev/pci/if_alc.c
index f56fc66..d89f552 100644
--- a/sys/dev/pci/if_alc.c
+++ b/sys/dev/pci/if_alc.c
@@ -3403,6 +3403,8 @@ alc_iff(struct alc_softc *sc)
 	uint32_t mchash[2];
 	uint32_t rxcfg;
 
+	mchash[0] = mchash[1] = 0xFFFFFFFF;
+
 	rxcfg = CSR_READ_4(sc, ALC_MAC_CFG);
 	rxcfg &= ~(MAC_CFG_ALLMULTI | MAC_CFG_BCAST | MAC_CFG_PROMISC);
 	ifp->if_flags &= ~IFF_ALLMULTI;
@@ -3412,14 +3414,11 @@ alc_iff(struct alc_softc *sc)
 	 */
 	rxcfg |= MAC_CFG_BCAST;
 
-	if (ifp->if_flags & IFF_PROMISC || ec->ec_multicnt > 0) {
-		ifp->if_flags |= IFF_ALLMULTI;
-		if (ifp->if_flags & IFF_PROMISC)
-			rxcfg |= MAC_CFG_PROMISC;
-		else
-			rxcfg |= MAC_CFG_ALLMULTI;
-		mchash[0] = mchash[1] = 0xFFFFFFFF;
-	} else {
+	if (ifp->if_flags & IFF_PROMISC)
+		rxcfg |= MAC_CFG_PROMISC;
+	else if (ifp->if_flags & IFF_ALLMULTI)
+		rxcfg |= MAC_CFG_ALLMULTI;
+	else {
 		/* Program new filter. */
 		memset(mchash, 0, sizeof(mchash));
 
-- 
2.8.2

the same code exists in ale(4) and age(4), but I do not own these devices.



Home | Main Index | Thread Index | Old Index