]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.4.177/mac80211-fix-miscounting-of-ttl-dropped-frames.patch
Linux 4.4.177
[thirdparty/kernel/stable-queue.git] / releases / 4.4.177 / mac80211-fix-miscounting-of-ttl-dropped-frames.patch
1 From 68e07a25650b7de0b47bdb756917fbea1ea636dd Mon Sep 17 00:00:00 2001
2 From: Bob Copeland <me@bobcopeland.com>
3 Date: Thu, 17 Jan 2019 16:32:42 -0500
4 Subject: mac80211: fix miscounting of ttl-dropped frames
5
6 [ Upstream commit a0dc02039a2ee54fb4ae400e0b755ed30e73e58c ]
7
8 In ieee80211_rx_h_mesh_fwding, we increment the 'dropped_frames_ttl'
9 counter when we decrement the ttl to zero. For unicast frames
10 destined for other hosts, we stop processing the frame at that point.
11
12 For multicast frames, we do not rebroadcast it in this case, but we
13 do pass the frame up the stack to process it on this STA. That
14 doesn't match the usual definition of "dropped," so don't count
15 those as such.
16
17 With this change, something like `ping6 -i0.2 ff02::1%mesh0` from a
18 peer in a ttl=1 network no longer increments the counter rapidly.
19
20 Signed-off-by: Bob Copeland <bobcopeland@fb.com>
21 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
22 Signed-off-by: Sasha Levin <sashal@kernel.org>
23 ---
24 net/mac80211/rx.c | 4 +++-
25 1 file changed, 3 insertions(+), 1 deletion(-)
26
27 diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
28 index acacceec8cd86..833ad779659c8 100644
29 --- a/net/mac80211/rx.c
30 +++ b/net/mac80211/rx.c
31 @@ -2340,7 +2340,9 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
32 skb_set_queue_mapping(skb, q);
33
34 if (!--mesh_hdr->ttl) {
35 - IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_ttl);
36 + if (!is_multicast_ether_addr(hdr->addr1))
37 + IEEE80211_IFSTA_MESH_CTR_INC(ifmsh,
38 + dropped_frames_ttl);
39 goto out;
40 }
41
42 --
43 2.19.1
44