From owner-svn-src-head@FreeBSD.ORG Mon May 25 19:48:49 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96A3C342; Mon, 25 May 2015 19:48:49 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 842572DA; Mon, 25 May 2015 19:48:49 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4PJmnJQ019613; Mon, 25 May 2015 19:48:49 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4PJmnMd019612; Mon, 25 May 2015 19:48:49 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201505251948.t4PJmnMd019612@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 25 May 2015 19:48:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283539 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 May 2015 19:48:49 -0000 Author: glebius Date: Mon May 25 19:48:48 2015 New Revision: 283539 URL: https://svnweb.freebsd.org/changeset/base/283539 Log: When sending RTM_IEEE80211_CSA, RTM_IEEE80211_RADAR, RTM_IEEE80211_CAC and RTM_IEEE80211_RADIO routing messages, broadcast them on all vap interfaces instead of sending them on parent. Reviewed by: adrian Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/net80211/ieee80211_freebsd.c Modified: head/sys/net80211/ieee80211_freebsd.c ============================================================================== --- head/sys/net80211/ieee80211_freebsd.c Mon May 25 19:18:16 2015 (r283538) +++ head/sys/net80211/ieee80211_freebsd.c Mon May 25 19:48:48 2015 (r283539) @@ -694,8 +694,9 @@ void ieee80211_notify_csa(struct ieee80211com *ic, const struct ieee80211_channel *c, int mode, int count) { - struct ifnet *ifp = ic->ic_ifp; struct ieee80211_csa_event iev; + struct ieee80211vap *vap; + struct ifnet *ifp; memset(&iev, 0, sizeof(iev)); iev.iev_flags = c->ic_flags; @@ -703,42 +704,53 @@ ieee80211_notify_csa(struct ieee80211com iev.iev_ieee = c->ic_ieee; iev.iev_mode = mode; iev.iev_count = count; - CURVNET_SET(ifp->if_vnet); - rt_ieee80211msg(ifp, RTM_IEEE80211_CSA, &iev, sizeof(iev)); - CURVNET_RESTORE(); + TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { + ifp = vap->iv_ifp; + CURVNET_SET(ifp->if_vnet); + rt_ieee80211msg(ifp, RTM_IEEE80211_CSA, &iev, sizeof(iev)); + CURVNET_RESTORE(); + } } void ieee80211_notify_radar(struct ieee80211com *ic, const struct ieee80211_channel *c) { - struct ifnet *ifp = ic->ic_ifp; struct ieee80211_radar_event iev; + struct ieee80211vap *vap; + struct ifnet *ifp; memset(&iev, 0, sizeof(iev)); iev.iev_flags = c->ic_flags; iev.iev_freq = c->ic_freq; iev.iev_ieee = c->ic_ieee; - CURVNET_SET(ifp->if_vnet); - rt_ieee80211msg(ifp, RTM_IEEE80211_RADAR, &iev, sizeof(iev)); - CURVNET_RESTORE(); + TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { + ifp = vap->iv_ifp; + CURVNET_SET(ifp->if_vnet); + rt_ieee80211msg(ifp, RTM_IEEE80211_RADAR, &iev, sizeof(iev)); + CURVNET_RESTORE(); + } } void ieee80211_notify_cac(struct ieee80211com *ic, const struct ieee80211_channel *c, enum ieee80211_notify_cac_event type) { - struct ifnet *ifp = ic->ic_ifp; struct ieee80211_cac_event iev; + struct ieee80211vap *vap; + struct ifnet *ifp; memset(&iev, 0, sizeof(iev)); iev.iev_flags = c->ic_flags; iev.iev_freq = c->ic_freq; iev.iev_ieee = c->ic_ieee; iev.iev_type = type; - CURVNET_SET(ifp->if_vnet); - rt_ieee80211msg(ifp, RTM_IEEE80211_CAC, &iev, sizeof(iev)); - CURVNET_RESTORE(); + TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { + ifp = vap->iv_ifp; + CURVNET_SET(ifp->if_vnet); + rt_ieee80211msg(ifp, RTM_IEEE80211_CAC, &iev, sizeof(iev)); + CURVNET_RESTORE(); + } } void @@ -782,14 +794,18 @@ ieee80211_notify_country(struct ieee8021 void ieee80211_notify_radio(struct ieee80211com *ic, int state) { - struct ifnet *ifp = ic->ic_ifp; struct ieee80211_radio_event iev; + struct ieee80211vap *vap; + struct ifnet *ifp; memset(&iev, 0, sizeof(iev)); iev.iev_state = state; - CURVNET_SET(ifp->if_vnet); - rt_ieee80211msg(ifp, RTM_IEEE80211_RADIO, &iev, sizeof(iev)); - CURVNET_RESTORE(); + TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { + ifp = vap->iv_ifp; + CURVNET_SET(ifp->if_vnet); + rt_ieee80211msg(ifp, RTM_IEEE80211_RADIO, &iev, sizeof(iev)); + CURVNET_RESTORE(); + } } void