Thread (4 messages) 4 messages, 2 authors, 2021-04-12

Re: [PATCH net-next] icmp: pass RFC 8335 reply messages to ping_rcv

From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: 2021-04-12 19:28:56

On Mon, Apr 12, 2021 at 3:09 PM Andreas Roeseler
[off-list ref] wrote:
quoted hunk ↗ jump to hunk
The current icmp_rcv function drops all unknown ICMP types, including
ICMP_EXT_ECHOREPLY (type 43). In order to parse Extended Echo Reply messages, we have
to pass these packets to the ping_rcv function, which does not do any
other filtering and passes the packet to the designated socket.

Pass incoming RFC 8335 ICMP Extended Echo Reply packets to the ping_rcv
handler instead of discarding the packet.

Signed-off-by: Andreas Roeseler <redacted>
---
 net/ipv4/icmp.c | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 76990e13a2f9..8bd988fbcb31 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -1196,6 +1196,11 @@ int icmp_rcv(struct sk_buff *skb)
                goto success_check;
        }

+       if (icmph->type == ICMP_EXT_ECHOREPLY) {
+               success = ping_rcv(skb);
+               goto success_check;
+       }
+
Do you need the same for ICMPV6_EXT_ECHO_REPLY ?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help