icmp: ICMPV6: pass RFC 8335 reply messages to ping_rcv
Subsystems (3)
PATCH v2 1/1 icmp: ICMPV6: 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.
---
Changes:
v1 -> v2:
- Add ICMPV6 to patch
--- net/ipv4/icmp.c | 5 +++++ net/ipv6/icmp.c | 4 ++++ 2 files changed, 9 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 *
net/ipv6/icmp.c +4 -0
@@ -916,6 +916,10 @@ static int icmpv6_rcv(struct sk_buff *skb) success =ping_rcv (skb);break ; +case ICMPV6_EXT_ECHO_REPLY : + success =ping_rcv (skb); +break ; +case ICMPV6_PKT_TOOBIG :/* BUGGG_FUTURE: if packet contains rthdr, we cannot update standard destination cache. Seems, only "advanced"
Signature · 1 line
2.31.1
Quoted 10 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]>
for future patches: please add reviewers of previous revisions directly to the CC:
Quoted 15 lines · Willem de Bruijn
Quoted 13 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.
Quoted 6 lines
Quoted 1 line
Signed-off-by Andreas Roeseler <[email protected]>Acked-by Willem de Bruijn <[email protected]>for future patches: please add reviewers of previous revisions directly to the CC:
Please let me know if there is any feedback/comments for this patch