[V2] Add RFC 8335 Definitions from Linux 5.12

Message ID 20210426160146.2934-1-andreas.a.roeseler@gmail.com
State Superseded
Headers
Series [V2] Add RFC 8335 Definitions from Linux 5.12 |

Commit Message

Andreas Roeseler April 26, 2021, 4:01 p.m. UTC
  RFC 8335 defines the network utility PROBE, which builds off of the
capabilities of Ping to query more detailed interface information from
networking nodes.

The definitions included in this patchset have been accepted into the
linux net-next branch and will be included in Linux 5.12. This
patchset adds the same definitions to the glibc for use in the
iputils package.

The relevant commits for the Linux definitions can be found here:
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=2b246b2569cd2ac6ff700d0dce56b8bae29b1842
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=750f4fc2a12f6632b5aa04526bf57fa06bfe8467

These changes have been tested by running the glibc tests on x86_64

Signed-off-by: Andreas Roeseler <andreas.a.roeseler@gmail.com>
---
Changes:
v1 -> v2:
- Add more specific prefixes to constants
---
 inet/netinet/icmp6.h          |  2 ++
 sysdeps/gnu/netinet/ip_icmp.h | 18 ++++++++++++++++++
 2 files changed, 20 insertions(+)
  

Comments

Florian Weimer April 26, 2021, 4:03 p.m. UTC | #1
* Andreas Roeseler:

> RFC 8335 defines the network utility PROBE, which builds off of the
> capabilities of Ping to query more detailed interface information from
> networking nodes.
>
> The definitions included in this patchset have been accepted into the
> linux net-next branch and will be included in Linux 5.12. This
> patchset adds the same definitions to the glibc for use in the
> iputils package.
>
> The relevant commits for the Linux definitions can be found here:
> https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=2b246b2569cd2ac6ff700d0dce56b8bae29b1842
> https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=750f4fc2a12f6632b5aa04526bf57fa06bfe8467

The names should be teh same on the glibc and Linus side.  These commits
still use the old names.

Thanks,
Florian
  
Andreas Roeseler April 26, 2021, 4:16 p.m. UTC | #2
On Mon, 2021-04-26 at 18:03 +0200, Florian Weimer wrote:
> * Andreas Roeseler:
> 
> > RFC 8335 defines the network utility PROBE, which builds off of the
> > capabilities of Ping to query more detailed interface information
> > from
> > networking nodes.
> > 
> > The definitions included in this patchset have been accepted into
> > the
> > linux net-next branch and will be included in Linux 5.12. This
> > patchset adds the same definitions to the glibc for use in the
> > iputils package.
> > 
> > The relevant commits for the Linux definitions can be found here:
> > https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=2b246b2569cd2ac6ff700d0dce56b8bae29b1842
> > https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=750f4fc2a12f6632b5aa04526bf57fa06bfe8467
> 
> The names should be teh same on the glibc and Linus side.  These
> commits
> still use the old names.
> 
Ok then I think I misunderstood your comment on V1 of this patch.
Should I edit these definitions in Linux and then try to submit this
patch once they have been changed, or can the definitions in V1 of this
patch get merged?

> Thanks,
> Florian
>
  
Andreas Roeseler April 28, 2021, 11:51 p.m. UTC | #3
On Mon, 2021-04-26 at 11:16 -0500, Andreas Roeseler wrote:
> On Mon, 2021-04-26 at 18:03 +0200, Florian Weimer wrote:
> > * Andreas Roeseler:
> > 
> > > RFC 8335 defines the network utility PROBE, which builds off of the
> > > capabilities of Ping to query more detailed interface information
> > > from
> > > networking nodes.
> > > 
> > > The definitions included in this patchset have been accepted into
> > > the
> > > linux net-next branch and will be included in Linux 5.12. This
> > > patchset adds the same definitions to the glibc for use in the
> > > iputils package.
> > > 
> > > The relevant commits for the Linux definitions can be found here:
> > > https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=2b246b2569cd2ac6ff700d0dce56b8bae29b1842
> > > https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=750f4fc2a12f6632b5aa04526bf57fa06bfe8467
> > 
> > The names should be teh same on the glibc and Linus side.  These
> > commits
> > still use the old names.
> > 
> Ok then I think I misunderstood your comment on V1 of this patch.
> Should I edit these definitions in Linux and then try to submit this
> patch once they have been changed, or can the definitions in V1 of this
> patch get merged?
> 
> > Thanks,
> > Florian
> > 
> 
> 

As of commit e542d29ca81d005651680a0a697b72ca13ddc4cc, the constants in
the Linux kernel have been updated to match the definitions in this
patchset.

The commit can be found in full here
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=e542d29ca81d005651680a0a697b72ca13ddc4cc
  
Florian Weimer April 30, 2021, 9:56 a.m. UTC | #4
* Andreas Roeseler:

> As of commit e542d29ca81d005651680a0a697b72ca13ddc4cc, the constants in
> the Linux kernel have been updated to match the definitions in this
> patchset.
>
> The commit can be found in full here
> https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=e542d29ca81d005651680a0a697b72ca13ddc4cc

Thanks for being flexible about this.  Would you please repost a v3 with
updated URLs?

Thanks,
Florian
  

Patch

diff --git a/inet/netinet/icmp6.h b/inet/netinet/icmp6.h
index 22b82335ec..f0df16123e 100644
--- a/inet/netinet/icmp6.h
+++ b/inet/netinet/icmp6.h
@@ -69,6 +69,8 @@  struct icmp6_hdr
 #define MLD_LISTENER_QUERY          130
 #define MLD_LISTENER_REPORT         131
 #define MLD_LISTENER_REDUCTION      132
+#define ICMP6_EXT_ECHO_REQUEST	    160
+#define ICMP6_EXT_ECHO_REPLY	    161
 
 #define ICMP6_DST_UNREACH_NOROUTE     0 /* no route to destination */
 #define ICMP6_DST_UNREACH_ADMIN       1 /* communication with destination */
diff --git a/sysdeps/gnu/netinet/ip_icmp.h b/sysdeps/gnu/netinet/ip_icmp.h
index 5db7ac7c37..ec7137253f 100644
--- a/sysdeps/gnu/netinet/ip_icmp.h
+++ b/sysdeps/gnu/netinet/ip_icmp.h
@@ -89,6 +89,24 @@  struct icmphdr
 #define ICMP_EXC_TTL		0	/* TTL count exceeded		*/
 #define ICMP_EXC_FRAGTIME	1	/* Fragment Reass time exceeded	*/
 
+/* Codes for ICMP_EXT_ECHO (PROBE) */
+#define ICMP_EXT_ECHO		42
+#define ICMP_EXT_ECHOREPLY	43
+#define ICMP_EXT_CODE_MAL_QUERY	1	/* Malformed Query */
+#define ICMP_EXT_CODE_NO_IF	2	/* No such Interface */
+#define ICMP_EXT_CODE_NO_TABLE_ENT	3	/* No table entry */
+#define ICMP_EXT_CODE_MULT_IFS	4	/* Multiple Interfaces Satisfy Query */
+
+/* Constants for EXT_ECHO (PROBE) */
+#define ICMP_EXT_ECHOREPLY_ACTIVE	(1 << 2)/* active bit in reply */
+#define ICMP_EXT_ECHOREPLY_IPV4		(1 << 1)/* ipv4 bit in reply */
+#define ICMP_EXT_ECHOREPLY_IPV6		1	/* ipv6 bit in reply */
+#define ICMP_EXT_ECHO_CTYPE_NAME	1
+#define ICMP_EXT_ECHO_CTYPE_INDEX	2
+#define ICMP_EXT_ECHO_CTYPE_ADDR	3
+#define ICMP_AFI_IP			1	/* Address Family Identifier for IPV4 */
+#define ICMP_AFI_IP6			2	/* Address Family Identifier for IPV6 */
+
 
 #ifdef __USE_MISC
 /*