From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Bob Copeland <me@bobcopeland.com>,
Bob Copeland <bobcopeland@fb.com>,
Johannes Berg <johannes.berg@intel.com>,
Sasha Levin <sashal@kernel.org>,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 4.9 12/27] mac80211: fix miscounting of ttl-dropped frames
Date: Thu, 14 Feb 2019 21:14:09 -0500 [thread overview]
Message-ID: <20190215021424.178979-12-sashal@kernel.org> (raw)
In-Reply-To: <20190215021424.178979-1-sashal@kernel.org>
From: Bob Copeland <me@bobcopeland.com>
[ Upstream commit a0dc02039a2ee54fb4ae400e0b755ed30e73e58c ]
In ieee80211_rx_h_mesh_fwding, we increment the 'dropped_frames_ttl'
counter when we decrement the ttl to zero. For unicast frames
destined for other hosts, we stop processing the frame at that point.
For multicast frames, we do not rebroadcast it in this case, but we
do pass the frame up the stack to process it on this STA. That
doesn't match the usual definition of "dropped," so don't count
those as such.
With this change, something like `ping6 -i0.2 ff02::1%mesh0` from a
peer in a ttl=1 network no longer increments the counter rapidly.
Signed-off-by: Bob Copeland <bobcopeland@fb.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/mac80211/rx.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 93c332737e86..fdbfdb04abe8 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2509,7 +2509,9 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
skb_set_queue_mapping(skb, q);
if (!--mesh_hdr->ttl) {
- IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_ttl);
+ if (!is_multicast_ether_addr(hdr->addr1))
+ IEEE80211_IFSTA_MESH_CTR_INC(ifmsh,
+ dropped_frames_ttl);
goto out;
}
--
2.19.1
next parent reply other threads:[~2019-02-15 2:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190215021424.178979-1-sashal@kernel.org>
2019-02-15 2:14 ` Sasha Levin [this message]
2019-02-15 2:14 ` [PATCH AUTOSEL 4.9 14/27] libceph: avoid KEEPALIVE_PENDING races in ceph_con_keepalive() Sasha Levin
2019-02-15 2:14 ` [PATCH AUTOSEL 4.9 18/27] net: altera_tse: fix connect_local_phy error path Sasha Levin
2019-02-15 2:14 ` [PATCH AUTOSEL 4.9 19/27] sfc: suppress duplicate nvmem partition types in efx_ef10_mtd_probe Sasha Levin
2019-02-15 2:14 ` [PATCH AUTOSEL 4.9 20/27] ax25: fix possible use-after-free Sasha Levin
2019-02-15 2:14 ` [PATCH AUTOSEL 4.9 21/27] net: usb: asix: ax88772_bind return error when hw_reset fail Sasha Levin
2019-02-15 2:14 ` [PATCH AUTOSEL 4.9 22/27] ibmveth: Do not process frames after calling napi_reschedule Sasha Levin
2019-02-15 2:14 ` [PATCH AUTOSEL 4.9 23/27] mac80211: don't initiate TDLS connection if station is not associated to AP Sasha Levin
2019-02-15 2:14 ` [PATCH AUTOSEL 4.9 24/27] mac80211: Add attribute aligned(2) to struct 'action' Sasha Levin
2019-02-15 2:14 ` [PATCH AUTOSEL 4.9 25/27] cfg80211: extend range deviation for DMG Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190215021424.178979-12-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=bobcopeland@fb.com \
--cc=johannes.berg@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=me@bobcopeland.com \
--cc=netdev@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).