Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 May 2002 18:36:21 +0200 (SAT)
From:      John Hay <jhay@icomtek.csir.co.za>
To:        imp@village.org (M. Warner Losh)
Cc:        finlayson@live.com, freebsd-mobile@FreeBSD.ORG, freebsd-net@FreeBSD.ORG
Subject:   Re: Multicast problem with "wi" driver in promiscuous mode - any resolution?
Message-ID:  <200205211636.g4LGaL691810@zibbi.icomtek.csir.co.za>
In-Reply-To: <20020521.094648.109072840.imp@village.org> from "M. Warner Losh" at "May 21, 2002 09:46:48 am"

next in thread | previous in thread | raw e-mail | index | archive | help
> I don't think anybody has applied fixes to the wi driver in that time
> frame for this purpose.  Have fun :-(.

The problem is that the wavelan/orinoco cards at least, only have space
for 16 multicast addresses and don't have an "all multicast" bit, so if
you go over 16 addresses or want to catch all multicast packets, you
have to enable promicious mode. I have a work in progress patch from
a while back that did work if I remember correctly. :-)

The reason I didn't go much further with it was because I found that
the Orinoco cards stayed at 2Mbit when promiscious mode was enabled,
so at the end I just tunneled the multicast stuff over the wireless
net.

John
-- 
John Hay -- John.Hay@icomtek.csir.co.za / jhay@FreeBSD.org


Index: if_wi.c
===================================================================
RCS file: /home/ncvs/src/sys/i386/isa/Attic/if_wi.c,v
retrieving revision 1.18.2.14
diff -u -r1.18.2.14 if_wi.c
--- if_wi.c	31 Jan 2002 16:56:59 -0000	1.18.2.14
+++ if_wi.c	19 Feb 2002 09:04:22 -0000
@@ -1231,13 +1231,26 @@
 
 	bzero((char *)&mcast, sizeof(mcast));
 
-	mcast.wi_type = WI_RID_MCAST;
-	mcast.wi_len = (3 * 16) + 1;
-
-	if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) {
+	if (ifp->if_flags & IFF_ALLMULTI &&
+	    !(sc->wi_if_flags & IFF_ALLMULTI)) {
+#if 0
+		mcast.wi_type = WI_RID_MCAST;
+		mcast.wi_len = (3 * 16) + 1;
 		wi_write_record(sc, (struct wi_ltv_gen *)&mcast);
+#endif
+
+		sc->wi_if_flags |= IFF_ALLMULTI;
+		ifpromisc(ifp, 1);
 		return;
 	}
+	if (!(ifp->if_flags & IFF_ALLMULTI) &&
+	    sc->wi_if_flags & IFF_ALLMULTI) {
+		printf("wi%d: switch of all multicast\n", ifp->if_unit);
+		sc->wi_if_flags &= ~IFF_ALLMULTI;
+		ifpromisc(ifp, 0);
+		if (ifp->if_flags & IFF_PROMISC)
+			return;
+	}
 
 	LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
 		if (ifma->ifma_addr->sa_family != AF_LINK)
@@ -1247,11 +1260,13 @@
 			    (char *)&mcast.wi_mcast[i], ETHER_ADDR_LEN);
 			i++;
 		} else {
-			bzero((char *)&mcast, sizeof(mcast));
-			break;
+			printf("wi%d: Oops too many multicast addresses\n",
+			    ifp->if_unit);
+			return;
 		}
 	}
 
+	mcast.wi_type = WI_RID_MCAST;
 	mcast.wi_len = (i * 3) + 1;
 	wi_write_record(sc, (struct wi_ltv_gen *)&mcast);
 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200205211636.g4LGaL691810>