Date: Mon, 25 May 2015 19:48:49 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r283539 - head/sys/net80211 Message-ID: <201505251948.t4PJmnMd019612@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505251948.t4PJmnMd019612>