diff options
author | Eric Dumazet <edumazet@google.com> | 2025-02-26 18:34:37 +0000 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2025-02-28 14:41:33 -0800 |
commit | a7e38208fe71498102de3ea9d20cfe847cdb6893 (patch) | |
tree | 1c89d52177ad3d603bc2b015020c78b153686fed /net/ipv6 | |
parent | daeb6a8f3b00d3b6f40593d80ab6be4f6d3d968d (diff) |
inet: ping: avoid skb_clone() dance in ping_rcv()
ping_rcv() callers currently call skb_free() or consume_skb(),
forcing ping_rcv() to clone the skb.
After this patch ping_rcv() is now 'consuming' the original skb,
either moving to a socket receive queue, or dropping it.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/20250226183437.1457318-3-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/icmp.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c index 4d14ab7f7e99..3fd19a84b358 100644 --- a/net/ipv6/icmp.c +++ b/net/ipv6/icmp.c @@ -957,12 +957,9 @@ static int icmpv6_rcv(struct sk_buff *skb) break; case ICMPV6_ECHO_REPLY: - reason = ping_rcv(skb); - break; - case ICMPV6_EXT_ECHO_REPLY: - reason = ping_rcv(skb); - break; + ping_rcv(skb); + return 0; case ICMPV6_PKT_TOOBIG: /* BUGGG_FUTURE: if packet contains rthdr, we cannot update |