Subject: if_xi broken with multicast
To: None <tech-net@netbsd.org>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-net
Date: 09/29/2002 18:48:15
--sm4nu43k4a2Rpi4c
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi,
Emanuel Dreyfus pointed me at a strange and annoying behavior of an if_xi
adapter: it's in promiscous mode, even when nothing requested it (ifconfig
doens't show PROMISC).
Looking at the code, it appears that the driver puts the adapter in
promiscous mode as soon as there is any multicast ethernet address
registered (it seems that the author couldn't get the multicast filters
working properly). As PROMISC isn't set this has the annoying side effect to
make the host send ICMP redirect for each foreign packet received.

I'm not in a position to get multicast working on this driver for now,
however we can workaround this broken behavior by setting the PROMISC
flag when the adapter is in promiscious mode. The attached patch does this.
Does anyone object if I commit it until a real fix is available ?

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
--

--sm4nu43k4a2Rpi4c
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="xi.diff"

Index: if_xi.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/pcmcia/if_xi.c,v
retrieving revision 1.21
diff -u -r1.21 if_xi.c
--- if_xi.c	2002/05/05 03:19:26	1.21
+++ if_xi.c	2002/09/26 21:36:45
@@ -1512,9 +1512,7 @@
 	bus_space_handle_t bsh = sc->sc_bsh;
 	bus_addr_t offset = sc->sc_offset;
 	struct ethercom *ether = &sc->sc_ethercom;
-#if 0
 	struct ifnet *ifp = &sc->sc_ethercom.ec_if;
-#endif
 #if WORKING_MULTICAST
 	struct ether_multistep step;
 	struct ether_multi *enm;
@@ -1540,6 +1538,7 @@
 			bus_space_write_1(sc->sc_bst, sc->sc_bsh,
 			    sc->sc_offset + SWC1,
 			    SWC1_PROMISC | SWC1_MCAST_PROM);
+			ifp->if_flags |= IFF_PROMISC;
 			return;
 		}
 

--sm4nu43k4a2Rpi4c--