Skip to contentSkip to conversation

Add support for sending RFC8335 PROBE

PATCH Superseded Andreas Roeseler 2 participants 5 messages Nov 14, 2020

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover Add support for 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

Andreas Roeseler (3):
net: add support for sending probe messages
icmp: define probe message types
ICMPv6: define probe message types

 include/linux/icmp.h   | 3 +++
 include/linux/icmpv6.h | 6 ++++++
 net/ipv4/ping.c        | 2 +-
 3 files changed, 10 insertions(+), 1 deletion(-)
Signature · 1 line
2.29.2
#1 lore raw

PATCH v2 1/3 net: add support for sending probe messages

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

---
 net/ipv4/ping.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/ping.c +1 -1
index 39b403f854c..70cb505f3e9 100644
@@ -303,7 +303,7 @@ out:
 
 static inline int ping_supported(int type, int code)
 {
-	if (type == ICMP_ECHO && code == 0)
+	if ((type == ICMP_ECHO || type == ICMP_EXT_ECHO) && code == 0)
 		return 1;
 	return 0;
 }
Signature · 1 line
2.29.2
#2 lore raw

PATCH v2 2/3 icmp: define probe message types

In reply to Andreas Roeseler

The 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

---
 include/linux/icmp.h | 3 +++
 1 file changed, 3 insertions(+)
include/linux/icmp.h +3 -0
index 474f2a51cf0..acc9bcbc72b 100644
@@ -64,6 +64,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	43
 
 struct icmphdr {
   __u8		type;
Signature · 1 line
2.29.2
#3 lore raw

PATCH v2 3/3 ICMPv6: define probe message types

In reply to Andreas Roeseler

The 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

---
 include/linux/icmpv6.h | 6 ++++++
 1 file changed, 6 insertions(+)
include/linux/icmpv6.h +6 -0
index ba45e6bc076..c6186774584 100644
@@ -137,6 +137,12 @@ static inline struct icmp6hdr *icmp6_hdr(const struct sk_buff *skb)
 #define ICMPV6_UNK_NEXTHDR		1
 #define ICMPV6_UNK_OPTION		2
 
+/*
+ *	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
maintainer
#4 lore raw

Re: [PATCH v2 net-next 3/3] ICMPv6: define probe message types

Quoted 12 lines · On Fri, 13 Nov 2020 19:24:17 -0800 Andreas Roeseler wrote:

The types of ICMPV6 Extended Echo Request and ICMPV6 Extended Echo Reply are defined in sections 2 and 3 of RFC8335.

include/linux/icmpv6.h +0 -0
index ba45e6bc076..c6186774584 100644
@@ -137,6 +137,12 @@ static inline struct icmp6hdr *icmp6_hdr(const struct sk_buff *skb)
 #define ICMPV6_UNK_NEXTHDR		1
 #define ICMPV6_UNK_OPTION		2

include/linux/icmpv6.h static inline struct icmp6hdr *icmp6_hdr(const struct sk_buff *skb) · line 148

Quoted 10 lines
include/linux/icmpv6.h +6 -0
 
+/*
+ *	Codes for EXT_ECHO (Probe)
+ */
+#define ICMPV6_EXT_ECHO_REQUEST		160
+#define ICMPV6_EXT_ECHO_REPLY		161
+
 /*
  *	constants for (set|get)sockopt
  */

Hm, quite strange. The context we're seeing here was removed 8 years ago by:

commit 607ca46e97a1b6594b29647d98a32d545c24bdff

Author: David Howells <[email protected]>
Date:   Sat Oct 13 10:46:48 2012 +0100

UAPI: (Scripted) Disintegrate include/linux

Are you sure you are on the right tree?