From owner-svn-src-head@freebsd.org Fri Feb 3 06:04:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9885FCCEBC2; Fri, 3 Feb 2017 06:04:07 +0000 (UTC) (envelope-from adrian@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 mx1.freebsd.org (Postfix) with ESMTPS id 431DE1DC3; Fri, 3 Feb 2017 06:04:07 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v13646Ni009842; Fri, 3 Feb 2017 06:04:06 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v13646eL009841; Fri, 3 Feb 2017 06:04:06 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201702030604.v13646eL009841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 3 Feb 2017 06:04:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313137 - 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.23 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: Fri, 03 Feb 2017 06:04:07 -0000 Author: adrian Date: Fri Feb 3 06:04:06 2017 New Revision: 313137 URL: https://svnweb.freebsd.org/changeset/base/313137 Log: [net80211] don't update quiet time counter values every probe request. The quiet time counter update is happening each time the IE is added, which also means it happens for each quiet time IE addition to the probe response. Only update the countdown if we request ie (ie, beacon updates.) Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Fri Feb 3 05:15:35 2017 (r313136) +++ head/sys/net80211/ieee80211_output.c Fri Feb 3 06:04:06 2017 (r313137) @@ -2016,16 +2016,23 @@ ieee80211_add_supportedchannels(uint8_t * Add an 11h Quiet time element to a frame. */ static uint8_t * -ieee80211_add_quiet(uint8_t *frm, struct ieee80211vap *vap) +ieee80211_add_quiet(uint8_t *frm, struct ieee80211vap *vap, int update) { struct ieee80211_quiet_ie *quiet = (struct ieee80211_quiet_ie *) frm; quiet->quiet_ie = IEEE80211_ELEMID_QUIET; quiet->len = 6; - if (vap->iv_quiet_count_value == 1) - vap->iv_quiet_count_value = vap->iv_quiet_count; - else if (vap->iv_quiet_count_value > 1) - vap->iv_quiet_count_value--; + + /* + * Only update every beacon interval - otherwise probe responses + * would update the quiet count value. + */ + if (update) { + if (vap->iv_quiet_count_value == 1) + vap->iv_quiet_count_value = vap->iv_quiet_count; + else if (vap->iv_quiet_count_value > 1) + vap->iv_quiet_count_value--; + } if (vap->iv_quiet_count_value == 0) { /* value 0 is reserved as per 802.11h standerd */ @@ -2812,7 +2819,7 @@ ieee80211_alloc_proberesp(struct ieee802 if (IEEE80211_IS_CHAN_DFS(ic->ic_bsschan) && (vap->iv_flags_ext & IEEE80211_FEXT_DFS)) { if (vap->iv_quiet) - frm = ieee80211_add_quiet(frm, vap); + frm = ieee80211_add_quiet(frm, vap, 0); } } if (IEEE80211_IS_CHAN_ANYG(bss->ni_chan)) @@ -3161,7 +3168,7 @@ ieee80211_beacon_construct(struct mbuf * if (IEEE80211_IS_CHAN_DFS(ic->ic_bsschan) && (vap->iv_flags_ext & IEEE80211_FEXT_DFS)) { if (vap->iv_quiet) - frm = ieee80211_add_quiet(frm,vap); + frm = ieee80211_add_quiet(frm,vap, 0); } } else bo->bo_quiet = frm; @@ -3596,7 +3603,7 @@ ieee80211_beacon_update(struct ieee80211 if (IEEE80211_IS_CHAN_DFS(ic->ic_bsschan) && (vap->iv_flags_ext & IEEE80211_FEXT_DFS) ){ if (vap->iv_quiet) - ieee80211_add_quiet(bo->bo_quiet, vap); + ieee80211_add_quiet(bo->bo_quiet, vap, 1); } if (isset(bo->bo_flags, IEEE80211_BEACON_ERP)) { /*