From owner-svn-src-head@freebsd.org Thu Jun 1 20:46:45 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 1A518B7E7B8; Thu, 1 Jun 2017 20:46:45 +0000 (UTC) (envelope-from avos@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 D73D8676ED; Thu, 1 Jun 2017 20:46:44 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v51KkhYd030738; Thu, 1 Jun 2017 20:46:43 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v51Kkh1I030737; Thu, 1 Jun 2017 20:46:43 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201706012046.v51Kkh1I030737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 1 Jun 2017 20:46:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319460 - 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: Thu, 01 Jun 2017 20:46:45 -0000 Author: avos Date: Thu Jun 1 20:46:43 2017 New Revision: 319460 URL: https://svnweb.freebsd.org/changeset/base/319460 Log: net80211: initialize i_seq for A-MPDU frames. Fragment number field (part of i_seq) is used for AAD calculation; as a result, without this patch every driver without h/w crypto support need to clear it before ieee80211_crypto_encap(). Also fixes rtwn(4) A-MPDU Tx with dev.rtwn.%d.hwcrypto tunable set to 0 (h/w crypto is disabled). Tested with: * Intel 6205, STA mode. * RTL8188EU, STA mode. Differential Revision: https://reviews.freebsd.org/D10753 Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Thu Jun 1 20:29:48 2017 (r319459) +++ head/sys/net80211/ieee80211_output.c Thu Jun 1 20:46:43 2017 (r319460) @@ -779,6 +779,9 @@ ieee80211_send_setup( tap = &ni->ni_tx_ampdu[tid]; if (tid != IEEE80211_NONQOS_TID && IEEE80211_AMPDU_RUNNING(tap)) { m->m_flags |= M_AMPDU_MPDU; + + /* NB: zero out i_seq field (for s/w encryption etc) */ + *(uint16_t *)&wh->i_seq[0] = 0; } else { if (IEEE80211_HAS_SEQ(type & IEEE80211_FC0_TYPE_MASK, type & IEEE80211_FC0_SUBTYPE_MASK)) @@ -1610,6 +1613,9 @@ ieee80211_encap(struct ieee80211vap *vap, struct ieee8 *(uint16_t *)wh->i_seq = htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT); M_SEQNO_SET(m, seqno); + } else { + /* NB: zero out i_seq field (for s/w encryption etc) */ + *(uint16_t *)wh->i_seq = 0; } } else { /*