From owner-svn-src-stable-12@freebsd.org Fri May 29 07:38:58 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F607331B7C; Fri, 29 May 2020 07:38:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49YGfB3mtNz4Dpm; Fri, 29 May 2020 07:38:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CE3E1427B; Fri, 29 May 2020 07:38:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04T7cwi3058945; Fri, 29 May 2020 07:38:58 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04T7cvF3058943; Fri, 29 May 2020 07:38:57 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005290738.04T7cvF3058943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 29 May 2020 07:38:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r361619 - stable/12/sys/net80211 X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/net80211 X-SVN-Commit-Revision: 361619 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2020 07:38:58 -0000 Author: avg Date: Fri May 29 07:38:57 2020 New Revision: 361619 URL: https://svnweb.freebsd.org/changeset/base/361619 Log: MFC r361364: net80211: post RTM_IFINFO notification after toggling IFF_DRV_RUNNING This is useful when a wireless driver is stopped or started in response to events like an RF Kill button press. Applications like wpa_supplicant depend on such events to have a correct view of interface state. Modified: stable/12/sys/net80211/ieee80211_freebsd.c stable/12/sys/net80211/ieee80211_proto.c stable/12/sys/net80211/ieee80211_proto.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net80211/ieee80211_freebsd.c ============================================================================== --- stable/12/sys/net80211/ieee80211_freebsd.c Fri May 29 07:37:27 2020 (r361618) +++ stable/12/sys/net80211/ieee80211_freebsd.c Fri May 29 07:38:57 2020 (r361619) @@ -962,6 +962,19 @@ ieee80211_notify_radio(struct ieee80211com *ic, int st } void +ieee80211_notify_ifnet_change(struct ieee80211vap *vap) +{ + struct ifnet *ifp = vap->iv_ifp; + + IEEE80211_DPRINTF(vap, IEEE80211_MSG_DEBUG, "%s\n", + "interface state change"); + + CURVNET_SET(ifp->if_vnet); + rt_ifmsg(ifp); + CURVNET_RESTORE(); +} + +void ieee80211_load_module(const char *modname) { Modified: stable/12/sys/net80211/ieee80211_proto.c ============================================================================== --- stable/12/sys/net80211/ieee80211_proto.c Fri May 29 07:37:27 2020 (r361618) +++ stable/12/sys/net80211/ieee80211_proto.c Fri May 29 07:38:57 2020 (r361619) @@ -1511,6 +1511,8 @@ ieee80211_start_locked(struct ieee80211vap *vap) * back in here and complete the work. */ ifp->if_drv_flags |= IFF_DRV_RUNNING; + ieee80211_notify_ifnet_change(vap); + /* * We are not running; if this we are the first vap * to be brought up auto-up the parent if necessary. @@ -1624,6 +1626,7 @@ ieee80211_stop_locked(struct ieee80211vap *vap) ieee80211_new_state_locked(vap, IEEE80211_S_INIT, -1); if (ifp->if_drv_flags & IFF_DRV_RUNNING) { ifp->if_drv_flags &= ~IFF_DRV_RUNNING; /* mark us stopped */ + ieee80211_notify_ifnet_change(vap); if (--ic->ic_nrunning == 0) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE | IEEE80211_MSG_DEBUG, Modified: stable/12/sys/net80211/ieee80211_proto.h ============================================================================== --- stable/12/sys/net80211/ieee80211_proto.h Fri May 29 07:37:27 2020 (r361618) +++ stable/12/sys/net80211/ieee80211_proto.h Fri May 29 07:38:57 2020 (r361619) @@ -455,4 +455,5 @@ void ieee80211_notify_node_auth(struct ieee80211_node void ieee80211_notify_country(struct ieee80211vap *, const uint8_t [], const uint8_t cc[2]); void ieee80211_notify_radio(struct ieee80211com *, int); +void ieee80211_notify_ifnet_change(struct ieee80211vap *); #endif /* _NET80211_IEEE80211_PROTO_H_ */