Skip to content

Commit d8c6f4b

Browse files
nhormandavem330
authored andcommitted
ipv[4|6]: correct dropwatch false positive in local_deliver_finish
I had a report recently of a user trying to use dropwatch to localise some frame loss, and they were getting false positives. Turned out they were using a user space SCTP stack that used raw sockets to grab frames. When we don't have a registered protocol for a given packet, we record it as a drop, even if a raw socket receieves the frame. We should only record the drop in the event a raw socket doesnt exist to receive the frames Tested by the reported successfully Signed-off-by: Neil Horman <[email protected]> Reported-by: William Reich <[email protected]> Tested-by: William Reich <[email protected]> CC: "David S. Miller" <[email protected]> CC: William Reich <[email protected]> CC: [email protected] Acked-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9e0aab8 commit d8c6f4b

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

net/ipv4/ip_input.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,11 @@ static int ip_local_deliver_finish(struct sk_buff *skb)
228228
icmp_send(skb, ICMP_DEST_UNREACH,
229229
ICMP_PROT_UNREACH, 0);
230230
}
231-
} else
231+
kfree_skb(skb);
232+
} else {
232233
IP_INC_STATS_BH(net, IPSTATS_MIB_INDELIVERS);
233-
kfree_skb(skb);
234+
consume_skb(skb);
235+
}
234236
}
235237
}
236238
out:

net/ipv6/ip6_input.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,11 @@ static int ip6_input_finish(struct sk_buff *skb)
241241
icmpv6_send(skb, ICMPV6_PARAMPROB,
242242
ICMPV6_UNK_NEXTHDR, nhoff);
243243
}
244-
} else
244+
kfree_skb(skb);
245+
} else {
245246
IP6_INC_STATS_BH(net, idev, IPSTATS_MIB_INDELIVERS);
246-
kfree_skb(skb);
247+
consume_skb(skb);
248+
}
247249
}
248250
rcu_read_unlock();
249251
return 0;

0 commit comments

Comments
 (0)