Subject: kern/12054: rtl81x9.c can go into inifite loop on multicast filter setup
To: None <gnats-bugs@gnats.netbsd.org>
From: None <itojun@itojun.org>
List: netbsd-bugs
Date: 01/27/2001 03:59:23
>Number:         12054
>Category:       kern
>Synopsis:       rtl81x9.c can go into inifite loop on multicast filter setup
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 27 04:02:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Jun-ichiro itojun Hagino
>Release:        1.5, 1.5Q
>Organization:
	kame.net
>Environment:
System: NetBSD starfruit.itojun.org 1.5R NetBSD 1.5R (STARFRUIT) #352: Sat Jan 27 19:32:35 JST 2001 itojun@starfruit.itojun.org:/usr/home/itojun/NetBSD/src/sys/arch/i386/compile/STARFRUIT i386
Architecture: i386
Machine: i386
>Description:
	See KAME PR 323.  kernel go into infinite loop when we configure
	multicast on rtk driver.

	http://orange.kame.net/dev/query-pr.cgi?pr=323
>How-To-Repeat:
	start pim6sd (or other multicast-sensitive programs) and observe
	kernel infinite loop.
>Fix:
	does it look right?  i have no rtl cards.

Index: rtl81x9.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/ic/rtl81x9.c,v
retrieving revision 1.27
diff -u -r1.27 rtl81x9.c
--- rtl81x9.c	2001/01/11 14:38:58	1.27
+++ rtl81x9.c	2001/01/27 11:58:25
@@ -565,6 +565,7 @@
 	rxfilt = CSR_READ_4(sc, RTK_RXCFG);
 
 	if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) {
+allmulti:
 		rxfilt |= RTK_RXCFG_RX_MULTI;
 		CSR_WRITE_4(sc, RTK_RXCFG, rxfilt);
 		CSR_WRITE_4(sc, RTK_MAR0, 0xFFFFFFFF);
@@ -581,7 +582,7 @@
 	while (enm != NULL) {
 		if (memcmp(enm->enm_addrlo, enm->enm_addrhi,
 		    ETHER_ADDR_LEN) != 0)
-			continue;
+			goto allmulti;
 
 		h = rtk_calchash(enm->enm_addrlo);
 		if (h < 32)
>Release-Note:
>Audit-Trail:
>Unformatted: