[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-mobile
Subject:    Re: Multicast problem with "wi" driver in promiscuous mode - any resolution?
From:       John Hay <jhay () icomtek ! csir ! co ! za>
Date:       2002-05-21 16:36:21
[Download RAW message or body]

> 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-mobile" in the body of the message


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic