netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Ido Schimmel <idosch@nvidia.com>,
	 Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: netdev@vger.kernel.org,  davem@davemloft.net,  kuba@kernel.org,
	 pabeni@redhat.com,  edumazet@google.com,  horms@kernel.org,
	 dsahern@kernel.org,  petrm@nvidia.com,  willemb@google.com,
	 daniel@iogearbox.net,  fw@strlen.de,  ishaangandhi@gmail.com,
	 rbonica@juniper.net,  tom@herbertland.com
Subject: Re: [PATCH net-next 3/3] selftests: traceroute: Add ICMP extensions tests
Date: Thu, 23 Oct 2025 17:25:23 -0400	[thread overview]
Message-ID: <willemdebruijn.kernel.2fa37d812e711@gmail.com> (raw)
In-Reply-To: <aPpMItF35gwpgzZx@shredder>

Ido Schimmel wrote:
> On Wed, Oct 22, 2025 at 06:12:13PM -0400, Willem de Bruijn wrote:
> > Ido Schimmel wrote:
> > > Test that ICMP extensions are reported correctly when enabled and not
> > > reported when disabled. Test both IPv4 and IPv6 and using different
> > > packet sizes, to make sure trimming / padding works correctly.
> > > 
> > > Disable ICMP rate limiting (defaults to 1 per-second per-target) so that
> > > the kernel will always generate ICMP errors when needed.
> > 
> > This reminds me that when I added SOL_IP/IP_RECVERR_4884, the selftest
> > was not integrated into kselftests. Commit eba75c587e81 points to
> > 
> > https://github.com/wdebruij/kerneltools/blob/master/tests/recv_icmp_v2.c
> > 
> > It might be useful to verify that the kernel recv path that parses
> > RFC 4884 compliant ICMP messages correctly handles these RFC 4884
> > messages.
> 
> FYI, I just ran this test with this series and it seems fine:
> 
> # sysctl -wq net.ipv4.icmp_errors_extension_mask=0x0
> # sysctl -wq net.ipv6.icmp.errors_extension_mask=0x0
> # ./recv_icmp_v2 
> 
> TEST(10, 0, 0)
> len=0 ee_info=0x0, ee_data=0x0 rfc4884=(0, 0x0, 0)
> 
> TEST(10, 41, 31)
> len=0 ee_info=0x0, ee_data=0x0 rfc4884=(0, 0x0, 0)
> 
> TEST(2, 0, 0)
> len=0 ee_info=0x0, ee_data=0x0 rfc4884=(0, 0x0, 0)
> 
> TEST(2, 0, 26)
> len=0 ee_info=0x0, ee_data=0x0 rfc4884=(0, 0x0, 0)
> OK
> # echo $?
> 0
> # sysctl -wq net.ipv4.icmp_errors_extension_mask=0x1
> # sysctl -wq net.ipv6.icmp.errors_extension_mask=0x1
> # ./recv_icmp_v2 
> 
> TEST(10, 0, 0)
> len=0 ee_info=0x10000000, ee_data=0x0 rfc4884=(0, 0x0, 0)
> 
> TEST(10, 41, 31)
> len=0 ee_info=0x10000000, ee_data=0x50 rfc4884=(80, 0x0, 0)
> 
> TEST(2, 0, 0)
> len=0 ee_info=0x0, ee_data=0x0 rfc4884=(0, 0x0, 0)
> 
> TEST(2, 0, 26)
> len=0 ee_info=0x0, ee_data=0x64 rfc4884=(100, 0x0, 0)
> OK
> # echo $?
> 0
> 
> When the extensions are enabled and the RFC4884 socket options are used,
> the offset to the extension structure relative to the beginning of the
> UDP payload seems correct. In both cases the "original datagram" field
> is 128 and if we remove the size of the headers from it we get the
> offset to the extension structure:
> 
> IPv4: 128 - ipv4_hdr - udp_hdr = 128 - 20 - 8 = 100
> IPv6: 128 - ipv6_hdr - udp_hdr = 128 - 40 - 8 = 80
> 
> In both cases SO_EE_RFC4884_FLAG_INVALID is not set.

Oh excellent. Thanks for running that.

  reply	other threads:[~2025-10-23 21:25 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-22  6:53 [PATCH net-next 0/3] icmp: Add RFC 5837 support Ido Schimmel
2025-10-22  6:53 ` [PATCH net-next 1/3] ipv4: " Ido Schimmel
2025-10-22 22:00   ` Willem de Bruijn
2025-10-23  8:35     ` Ido Schimmel
2025-10-22  6:53 ` [PATCH net-next 2/3] ipv6: " Ido Schimmel
2025-10-22  6:53 ` [PATCH net-next 3/3] selftests: traceroute: Add ICMP extensions tests Ido Schimmel
2025-10-22 22:12   ` Willem de Bruijn
2025-10-23  9:09     ` Ido Schimmel
2025-10-23 15:39     ` Ido Schimmel
2025-10-23 21:25       ` Willem de Bruijn [this message]
2025-10-22 13:26 ` [PATCH net-next 0/3] icmp: Add RFC 5837 support Jakub Kicinski
2025-10-22 13:58   ` Ido Schimmel
2025-10-22 15:10     ` Jakub Kicinski
2025-10-22 15:35       ` Ido Schimmel
2025-10-23  0:38         ` Jakub Kicinski
2025-10-24  1:48           ` Jakub Kicinski
2025-10-24 14:50             ` Ido Schimmel
2025-10-24 15:04               ` Jakub Kicinski
2025-10-22 17:29 ` David Ahern
2025-10-23 11:19   ` Ido Schimmel
2025-10-23 13:39   ` Willem de Bruijn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=willemdebruijn.kernel.2fa37d812e711@gmail.com \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=ishaangandhi@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=petrm@nvidia.com \
    --cc=rbonica@juniper.net \
    --cc=tom@herbertland.com \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).