From owner-freebsd-net Tue May 21 9:37:25 2002 Delivered-To: freebsd-net@freebsd.org Received: from zibbi.icomtek.csir.co.za (zibbi.icomtek.csir.co.za [146.64.24.58]) by hub.freebsd.org (Postfix) with ESMTP id D57BA37B409; Tue, 21 May 2002 09:36:58 -0700 (PDT) Received: (from jhay@localhost) by zibbi.icomtek.csir.co.za (8.11.6/8.11.6) id g4LGaL691810; Tue, 21 May 2002 18:36:21 +0200 (SAT) (envelope-from jhay) From: John Hay Message-Id: <200205211636.g4LGaL691810@zibbi.icomtek.csir.co.za> Subject: Re: Multicast problem with "wi" driver in promiscuous mode - any resolution? In-Reply-To: <20020521.094648.109072840.imp@village.org> from "M. Warner Losh" at "May 21, 2002 09:46:48 am" To: imp@village.org (M. Warner Losh) Date: Tue, 21 May 2002 18:36:21 +0200 (SAT) Cc: finlayson@live.com, freebsd-mobile@FreeBSD.ORG, freebsd-net@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org > 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