diff options
author | avos <avos@FreeBSD.org> | 2016-06-09 08:19:42 +0000 |
---|---|---|
committer | avos <avos@FreeBSD.org> | 2016-06-09 08:19:42 +0000 |
commit | 7879d049d82d375a9e4f725522752f6610e6d7a2 (patch) | |
tree | 1e66e84cd8b6130408a4ee8f05e2004c08d2bc20 | |
parent | e9a22d502fb9889fbe0f9648aff5efcab3820573 (diff) | |
download | FreeBSD-src-7879d049d82d375a9e4f725522752f6610e6d7a2.zip FreeBSD-src-7879d049d82d375a9e4f725522752f6610e6d7a2.tar.gz |
net80211: fix duplicate packet counter incrementation.
Remove 'if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);' from raw xmit
and apbridge path; it will be incremented by ieee80211_tx_complete()
after packet transmission.
Noticed by: Imre Vadasz <imre@vdsz.com>
-rw-r--r-- | sys/net80211/ieee80211_hostap.c | 4 | ||||
-rw-r--r-- | sys/net80211/ieee80211_output.c | 1 |
2 files changed, 2 insertions, 3 deletions
diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c index 5b7611e..643a610 100644 --- a/sys/net80211/ieee80211_hostap.c +++ b/sys/net80211/ieee80211_hostap.c @@ -412,8 +412,8 @@ hostap_deliver_data(struct ieee80211vap *vap, ieee80211_free_node(sta); } } - if (mcopy != NULL && ieee80211_vap_xmitpkt(vap, mcopy) == 0) - if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + if (mcopy != NULL) + (void) ieee80211_vap_xmitpkt(vap, mcopy); } if (m != NULL) { /* diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c index 1f49237..221abc2 100644 --- a/sys/net80211/ieee80211_output.c +++ b/sys/net80211/ieee80211_output.c @@ -647,7 +647,6 @@ ieee80211_output(struct ifnet *ifp, struct mbuf *m, if (ieee80211_classify(ni, m)) senderr(EIO); /* XXX */ - if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); IEEE80211_NODE_STAT(ni, tx_data); if (IEEE80211_IS_MULTICAST(wh->i_addr1)) { IEEE80211_NODE_STAT(ni, tx_mcast); |