add support sending RFC8335 PROBE
Subsystems (2)
v3 cover add support sending RFC8335 PROBE
The popular utility ping has several severe limitations such as the inability to query specific interfaces on a node and requiring bidirectional connectivity between the probing and the probed interfaces. RFC8335 attempts to solve these limitations by creating the new utility PROBE which is a specialized ICMP message that makes use of the ICMP Extension Structure outlined in RFC4884.
This patchset adds definitions for the ICMP Extended Echo Request and Reply (PROBE) types for both IPv4 and IPv6. It also expands the list of supported ICMP messages to accommodate PROBEs.
Changes since v1:
- Switch to correct base tree
Changes since v2:
- Switch to net-next tree 67c70b5eb2bf7d0496fcb62d308dc3096bc11553
Andreas Roeseler (3):
net: add support for sending RFC8335 PROBE
icmp: define PROBE message types
ICMPv6: define PROBE message types
include/uapi/linux/icmp.h | 3 +++ include/uapi/linux/icmpv6.h | 6 ++++++ net/ipv4/ping.c | 4 +++- 3 files changed, 12 insertions(+), 1 deletion(-)
Signature · 1 line
2.29.2
PATCH v3 1/3 net: add support for sending RFC8335 PROBE
Modifying the ping_supported function to support probe message types allows the user to send probe requests through the existing framework for sending ping requests.
---
Changes since v1:
- Switch to correct base tree
Changes since v2:
- Switch to net-next tree 67c70b5eb2bf7d0496fcb62d308dc3096bc11553
--- net/ipv4/ping.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/ipv4/ping.c +3 -1
@@ -453,7 +453,9 @@ EXPORT_SYMBOL_GPL(ping_bind);static inline int ping_supported (int family,int type,int code) {return (family ==AF_INET && type ==ICMP_ECHO && code ==0 ) || - (family ==AF_INET6 && type ==ICMPV6_ECHO_REQUEST && code ==0 ); + (family ==AF_INET && type ==ICMP_EXT_ECHO && code ==0 ) || + (family ==AF_INET6 && type ==ICMPV6_ECHO_REQUEST && code ==0 ) || + (family ==AF_INET6 && type ==ICMPV6_EXT_ECHO_REQUEST && code ==0 ); }/*
Signature · 1 line
2.29.2
Jakub Kicinski
maintainerRe: [PATCH v3 net-next 1/3] net: add support for sending RFC8335 PROBE
Quoted 5 lines · On Sat, 14 Nov 2020 12:56:11 -0800 Andreas Roeseler wrote:
Modifying the
ping_supportedfunction to support probe message types allows the user to send probe requests through the existing framework for sending ping requests.Signed-off-by Andreas Roeseler <[email protected]>
You need to reorder the patches so that defines are added first.
Otherwise if someone lands on this patch during bisection the kernel will not build:
../net/ipv4/ping.c: In function ‘ping_supported’:../net/ipv4/ping.c:456:39: error: ‘ICMP_EXT_ECHO’ undeclared (first use in this function); did you mean ‘ICMP_ECHO’?
456 | (family == AF_INET && type == ICMP_EXT_ECHO && code == 0) ||
| ^~~~~~~~~~~~~
| ICMP_ECHO
../net/ipv4/ping.c:456:39: note: each undeclared identifier is reported only once for each function it appears in
../net/ipv4/ping.c:458:40: error: ‘ICMPV6_EXT_ECHO_REQUEST’ undeclared (first use in this function); did you mean ‘ICMPV6_ECHO_REQUEST’?
458 | (family == AF_INET6 && type == ICMPV6_EXT_ECHO_REQUEST && code == 0);
| ^~~~~~~~~~~~~~~~~~~~~~~
| ICMPV6_ECHO_REQUEST
../net/ipv4/ping.c:459:1: error: control reaches end of non-void function [-Werror=return-type]
459 | }
| ^cc1: some warnings being treated as errors make[3]: *** [net/ipv4/ping.o] Error 1 make[2]: *** [net/ipv4] Error 2 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [net] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [__sub-make] Error 2
PATCH v3 2/3 icmp: define PROBE message types
In reply to Andreas RoeselerThe types of ICMP Extended Echo Request and ICMP Extended Echo Reply are defined in sections 2 and 3 of RFC8335.
---
Changes since v1:
- Switch to correct base tree
Changes since v2:
- Switch to net-next tree 67c70b5eb2bf7d0496fcb62d308dc3096bc11553
--- include/uapi/linux/icmp.h | 3 +++ 1 file changed, 3 insertions(+)
include/uapi/linux/icmp.h +3 -0
@@ -66,6 +66,9 @@#define ICMP_EXC_TTL 0/* TTL count exceeded */ #define ICMP_EXC_FRAGTIME 1/* Fragment Reass time exceeded */ +/* Codes for EXT_ECHO (Probe) */ +#define ICMP_EXT_ECHO 42 +#define ICMP_EXT_ECHOREPLY 43struct icmphdr {__u8 type;
Signature · 1 line
2.29.2
PATCH v3 3/3 ICMPv6: define PROBE message types
In reply to Andreas RoeselerThe types of ICMPV6 Extended Echo Request and ICMPV6 Extended Echo Reply are defined in sections 2 and 3 of RFC8335.
---
Changes since v1:
- Switch to correct base tree
Changes since v2:
- Switch to net-next tree 67c70b5eb2bf7d0496fcb62d308dc3096bc11553
--- include/uapi/linux/icmpv6.h | 6 ++++++ 1 file changed, 6 insertions(+)
include/uapi/linux/icmpv6.h +6 -0
@@ -140,6 +140,12 @@ struct icmp6hdr {#define ICMPV6_UNK_OPTION 2#define ICMPV6_HDR_INCOMP 3 +/* +* Codes for EXT_ECHO (Probe) +*/ +#define ICMPV6_EXT_ECHO_REQUEST 160 +#define ICMPV6_EXT_ECHO_REPLY 161 +/* * constants for (set|get)sockopt */
Signature · 1 line
2.29.2