icmp: pass RFC 8335 reply messages to ping_rcv
Subsystems (3)
PATCH 1/1 icmp: pass RFC 8335 reply messages to ping_rcv
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.
--- net/ipv4/icmp.c | 5 +++++ 1 file changed, 5 insertions(+)
net/ipv4/icmp.c +5 -0
@@ -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; + } +/* * 18 is the highest 'known' ICMP type. Anything else is a mystery *
Signature · 1 line
2.30.0
Quoted 19 lines · Andreas Roeseler
The current
icmp_rcvfunction drops all unknown ICMP types, includingICMP_EXT_ECHOREPLY(type 43). In order to parse Extended Echo Reply messages, we have to pass these packets to theping_rcvfunction, 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_rcvhandler instead of discarding the packet.Signed-off-by Andreas Roeseler <[email protected]>--- net/ipv4/icmp.c | 5 +++++ 1 file changed, 5 insertions(+)net/ipv4/icmp.c +0
-0
net/ipv4/icmp.c int icmp_rcv(struct sk_buff *skb) · line 1203
Quoted 8 lines
net/ipv4/icmp.c +5
-0@@ -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 ?
Quoted 28 lines · Willem de Bruijn
Quoted 26 lines · Andreas Roeseler
The current
icmp_rcvfunction drops all unknown ICMP types, includingICMP_EXT_ECHOREPLY(type 43). In order to parse Extended Echo Reply messages, we have
to pass these packets to theping_rcvfunction, 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 <[email protected]>---
net/ipv4/icmp.c | 5 +++++1 file changed, 5 insertions(+)net/ipv4/icmp.c +0
-0@@ -1196,6 +1196,11 @@ int icmp_rcv(struct sk_buff *skb) goto success_check; }
Quoted 7 lines
net/ipv4/icmp.c int icmp_rcv(struct sk_buff *skb) · line 1203
Quoted 5 lines
net/ipv4/icmp.c +5
-0+ if (icmph->type == ICMP_EXT_ECHOREPLY) { + success = ping_rcv(skb); + goto success_check; + } +Do you need the same for
ICMPV6_EXT_ECHO_REPLY?
Yes, but this should be handled in icmpv6_rcv in net/ipv6/icmp.c and we're thinking of including all icmpv6 support for RFC 8335 (replying and parsing replies) in a separate patch.
Quoted 38 lines · Andreas Roeseler
Quoted 28 lines · Willem de Bruijn
Quoted 26 lines · Andreas Roeseler
The current
icmp_rcvfunction drops all unknown ICMP types, includingICMP_EXT_ECHOREPLY(type 43). In order to parse Extended Echo Reply messages, we have
to pass these packets to theping_rcvfunction, 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 <[email protected]>--- net/ipv4/icmp.c | 5 +++++ 1 file changed, 5 insertions(+)net/ipv4/icmp.c +0
-0@@ -1196,6 +1196,11 @@ int icmp_rcv(struct sk_buff *skb) goto success_check; }Quoted 7 lines
net/ipv4/icmp.c int icmp_rcv(struct sk_buff *skb) · line 1203
Quoted 5 lines
net/ipv4/icmp.c +5
-0+if (icmph->type ==ICMP_EXT_ECHOREPLY ) { + success =ping_rcv (skb); + goto success_check; + } +Do you need the same for
ICMPV6_EXT_ECHO_REPLY?
Quoted 3 lines
Yes, but this should be handled in
icmpv6_rcvinnet/ipv6/icmp.cand we're thinking of including all icmpv6 support for RFC 8335 (replying and parsing replies) in a separate patch.
Please send them together in the same patchset.
Sending ipv4 and ipv6 separately can lead to missing or subtly differently implemented features. It's preferable to be able to review both at the same time.