aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Copeland <me@bobcopeland.com>2019-01-17 16:32:42 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-03-05 17:58:49 +0100
commita2887f6fab989f87dd4f561329f42736e5168b73 (patch)
tree0a947b4d31d8b1f76f898b15c1c24ac74df406be
parentbbc300c8c75e69a690f4a2d0c4189529f5ea0c4e (diff)
downloadlinux-yocto-a2887f6fab989f87dd4f561329f42736e5168b73.tar.gz
linux-yocto-a2887f6fab989f87dd4f561329f42736e5168b73.tar.bz2
linux-yocto-a2887f6fab989f87dd4f561329f42736e5168b73.zip
mac80211: fix miscounting of ttl-dropped frames
[ 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>
-rw-r--r--net/mac80211/rx.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 828348b2a504..d7a05a994442 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2678,7 +2678,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;
}