Subject: port-evbppc/31131: [PATCH] Set multicast filter in if_emac.c::emac_init()
To: None <port-evbppc-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: None <fun@naobsd.org>
List: netbsd-bugs
Date: 09/03/2005 18:24:00
>Number:         31131
>Category:       port-evbppc
>Synopsis:       [PATCH] Set multicast filter in if_emac.c::emac_init()
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    port-evbppc-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 03 18:24:00 +0000 2005
>Originator:     FUKAUMI Naoki
>Release:        NetBSD 3.99.7
>Organization:
	FUKAUMI Naoki
>Environment:
System: NetBSD turion64.naobsd.org 3.99.7 NetBSD 3.99.7 (TURION64) #2: Tue Aug 16 19:43:57 JST 2005 root@turion64.naobsd.org:/usr/obj/amd64/sys/arch/amd64/compile/TURION64 amd64
Architecture: x86_64
Machine: amd64
>Description:
	emac(4) does not set multicast filter in emac_init(). It causes
	multicast table inconsistency between in-kernel and real device.
	(e.g. rtsol(8) at system startup will fail)
>How-To-Repeat:
	# echo ip6mode=autohost >> /etc/rc.conf
	# echo rtsol=YES rtsol_flags="emac0" >> /etc/rc.conf
>Fix:
	I have no time to test this patch, but it should work.
	(I made (maybe) same patch and tested it. But I lost it...)

	Please pull up to release branch.

Index: sys/arch/powerpc/ibm4xx/dev/if_emac.c
===================================================================
RCS file: /home/fun/cvsroot/NetBSD/src/sys/arch/powerpc/ibm4xx/dev/if_emac.c,v
retrieving revision 1.22
diff -u -p -r1.22 if_emac.c
--- sys/arch/powerpc/ibm4xx/dev/if_emac.c	30 Jan 2005 19:03:23 -0000	1.22
+++ sys/arch/powerpc/ibm4xx/dev/if_emac.c	3 Sep 2005 17:51:56 -0000
@@ -809,6 +809,11 @@ emac_init(struct ifnet *ifp)
 	    (ifp->if_flags & IFF_BROADCAST ? RMR_BAE : 0));
 
 	/*
+	 * Set multicast filter.
+	 */
+	emac_set_filter(sc);
+
+	/*
 	 * Set low- and urgent-priority request thresholds.
 	 */
 	EMAC_WRITE(sc, EMAC_TMR1,