From owner-svn-src-all@FreeBSD.ORG Sun Jan 31 11:30:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 147291065670; Sun, 31 Jan 2010 11:30:29 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 027788FC18; Sun, 31 Jan 2010 11:30:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0VBUSlv010465; Sun, 31 Jan 2010 11:30:28 GMT (envelope-from syrinx@svn.freebsd.org) Received: (from syrinx@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0VBUSLj010461; Sun, 31 Jan 2010 11:30:28 GMT (envelope-from syrinx@svn.freebsd.org) Message-Id: <201001311130.o0VBUSLj010461@svn.freebsd.org> From: Shteryana Shopova Date: Sun, 31 Jan 2010 11:30:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203274 - in stable/8/sys: net net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jan 2010 11:30:29 -0000 Author: syrinx Date: Sun Jan 31 11:30:28 2010 New Revision: 203274 URL: http://svn.freebsd.org/changeset/base/203274 Log: MFC r202935: While flushing the multicast filter of an interface, do not zero the relevant ifmultiaddr structures' reference to the parent interface, unless the parent interface is really detaching. While here, program only link layer multicast filters to a wlan's hardware parent interface. PR: kern/142391, kern/142392 Reviewed by: sam, rpaulo, bms Modified: stable/8/sys/net/if.c stable/8/sys/net/if_var.h stable/8/sys/net80211/ieee80211_ioctl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/net/if.c ============================================================================== --- stable/8/sys/net/if.c Sun Jan 31 11:20:27 2010 (r203273) +++ stable/8/sys/net/if.c Sun Jan 31 11:30:28 2010 (r203274) @@ -773,9 +773,10 @@ if_purgeaddrs(struct ifnet *ifp) } /* - * Remove any multicast network addresses from an interface. + * Remove any multicast network addresses from an interface when an ifnet + * is going away. */ -void +static void if_purgemaddrs(struct ifnet *ifp) { struct ifmultiaddr *ifma; @@ -3005,6 +3006,22 @@ if_delmulti(struct ifnet *ifp, struct so } /* + * Delete all multicast group membership for an interface. + * Should be used to quickly flush all multicast filters. + */ +void +if_delallmulti(struct ifnet *ifp) +{ + struct ifmultiaddr *ifma; + struct ifmultiaddr *next; + + IF_ADDR_LOCK(ifp); + TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next) + if_delmulti_locked(ifp, ifma, 0); + IF_ADDR_UNLOCK(ifp); +} + +/* * Delete a multicast group membership by group membership pointer. * Network-layer protocol domains must use this routine. * Modified: stable/8/sys/net/if_var.h ============================================================================== --- stable/8/sys/net/if_var.h Sun Jan 31 11:20:27 2010 (r203273) +++ stable/8/sys/net/if_var.h Sun Jan 31 11:30:28 2010 (r203274) @@ -832,7 +832,7 @@ void if_delmulti_ifma(struct ifmultiaddr void if_detach(struct ifnet *); void if_vmove(struct ifnet *, struct vnet *); void if_purgeaddrs(struct ifnet *); -void if_purgemaddrs(struct ifnet *); +void if_delallmulti(struct ifnet *); void if_down(struct ifnet *); struct ifmultiaddr * if_findmulti(struct ifnet *, struct sockaddr *); Modified: stable/8/sys/net80211/ieee80211_ioctl.c ============================================================================== --- stable/8/sys/net80211/ieee80211_ioctl.c Sun Jan 31 11:20:27 2010 (r203273) +++ stable/8/sys/net80211/ieee80211_ioctl.c Sun Jan 31 11:30:28 2010 (r203274) @@ -3199,15 +3199,18 @@ ieee80211_ioctl_updatemulti(struct ieee8 void *ioctl; IEEE80211_LOCK(ic); - if_purgemaddrs(parent); + if_delallmulti(parent); ioctl = parent->if_ioctl; /* XXX WAR if_allmulti */ parent->if_ioctl = NULL; TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { struct ifnet *ifp = vap->iv_ifp; struct ifmultiaddr *ifma; - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; (void) if_addmulti(parent, ifma->ifma_addr, NULL); + } } parent->if_ioctl = ioctl; ieee80211_runtask(ic, &ic->ic_mcast_task);