From: Kuniyuki Iwashima <kuniyu@google.com>
To: Eric Dumazet <edumazet@kernel.org>
Cc: Neal Cardwell <ncardwell@google.com>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
Kuniyuki Iwashima <kuni1840@gmail.com>,
netdev@vger.kernel.org
Subject: Re: [PATCH v1 net 6/8] selftest: net: packetdrill: Add ICMP and ICMPv6 tests.
Date: Tue, 17 Nov 2026 23:45:02 +0000 [thread overview]
Message-ID: <avzm6dKfqvyPgTC_@google.com> (raw)
In-Reply-To: <CAL4Wiiq3VFrjakaHqaBB74yTgZbb8MBvtzSMiTr778CY7MdggQ@mail.gmail.com>
On Tue, 17 Nov 2026 09:58:46 +0100, Eric Dumazet wrote:
> Le mar. 17 nov. 2026 à 06:35, Kuniyuki Iwashima <kuniyu@google.com> a écrit :
> >
> > tcp_icmp_ipv4.pkt and tcp_icmp_ipv6.pkt cover the scenarios
> > fixed by the preceding patches.
> >
> > tcp_v6_err() already checks the outer hop limit and
> > ip6_sk_accept_pmtu(), so Test 2 and 5 in tcp_icmp_ipv6.pkt
> > pass without the series.
> >
> > ICMP and ICMPv6 behaviour are unlikely to change, so splitting
> > into multiple files per test case is not worth it.
> >
> > Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
> > ---
> > .../net/packetdrill/tcp_icmp_ipv4.pkt | 98 ++++++++++++++++
> > .../net/packetdrill/tcp_icmp_ipv6.pkt | 111 ++++++++++++++++++
> > 2 files changed, 209 insertions(+)
> > create mode 100644 tools/testing/selftests/net/packetdrill/tcp_icmp_ipv4.pkt
> > create mode 100644 tools/testing/selftests/net/packetdrill/tcp_icmp_ipv6.pkt
> >
> > diff --git a/tools/testing/selftests/net/packetdrill/tcp_icmp_ipv4.pkt b/tools/testing/selftests/net/packetdrill/tcp_icmp_ipv4.pkt
> > new file mode 100644
> > index 000000000000..122bf9a14862
> > --- /dev/null
> > +++ b/tools/testing/selftests/net/packetdrill/tcp_icmp_ipv4.pkt
> > @@ -0,0 +1,98 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +--ip_version=ipv4
> > +
> > +`./defaults.sh`
> > +
> > +// Test 1: Client in TCP_SYN_SENT rejects ICMP quoting seq == snd_nxt (RFC 5927 4.1)
> > +// In SYN_SENT, SND.UNA = ISN, SND.NXT = ISN + 1.
> > +// The sequence number in ICMP must satisfy SND.UNA <= SEG.SEQ < SND.NXT.
> > +// An ICMP message quoting seq == 1 (snd_nxt) must be dropped, while seq == 0 (snd_una) aborts.
> > + 0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
> > + +0 fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
> > + +0 connect(3, ..., ...) = -1 EINPROGRESS (Operation now in progress)
> > + +0 > S 0:0(0) <...>
> > + // Out-of-window ICMP quoting seq == 1 (snd_nxt) must be dropped
> > + +0 < icmp unreachable host_unreachable [1:1(0)]
> > + // Socket stays in TCP_SYN_SENT, so SYN retransmission occurs after 1s
> > + +1 > S 0:0(0) <...>
> > + // In-window ICMP quoting seq == 0 (snd_una) is accepted and aborts connection
> > + +0 < icmp unreachable host_unreachable [0:0(0)]
> > + +0 %{ assert tcpi_state == TCP_CLOSE }%
> > + +0 getsockopt(3, SOL_SOCKET, SO_ERROR, [EHOSTUNREACH], [4]) = 0
> > + +0 close(3) = 0
> > +
> > +// Test 2: Client with IP_MINTTL (21) checks outer IP TTL in tcp_v4_err()
> > +// An ICMP with outer TTL < min_ttl (250) must be dropped, while outer TTL >= min_ttl
> > +// must be accepted even though the quoted inner IP header has lower TTL (64).
> > + +0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
> > + +0 setsockopt(3, SOL_IP, 21, [250], 4) = 0
>
> Ah.... could we instead update packedrill, adding IP_MINTTL ?
>
> Same for IPV6_MINHOPCOUNT
Will do.
next prev parent reply other threads:[~2026-11-17 23:45 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 5:35 [PATCH v1 net 0/8] tcp: Misc fixes for tcp_v[46]_err() Kuniyuki Iwashima
2026-11-17 5:35 ` [PATCH v1 net 1/8] tcp: Don't accept ICMP for SND.NXT in TCP_SYN_SENT Kuniyuki Iwashima
2026-11-17 8:35 ` Eric Dumazet
2026-11-17 23:30 ` Kuniyuki Iwashima
2026-11-17 5:35 ` [PATCH v1 net 2/8] tcp: Don't use inner IP TTL for IP_MINTTL in tcp_v4_err() Kuniyuki Iwashima
2026-11-17 8:42 ` Eric Dumazet
2026-11-17 23:35 ` Kuniyuki Iwashima
2026-11-17 5:35 ` [PATCH v1 net 3/8] tcp: Don't bypass GTSM check for reqsk Kuniyuki Iwashima
2026-11-17 8:45 ` Eric Dumazet
2026-11-17 23:42 ` Kuniyuki Iwashima
2026-11-17 5:35 ` [PATCH v1 net 4/8] tcp: Fix reqsk abort condition on ICMP errors Kuniyuki Iwashima
2026-11-17 8:49 ` Eric Dumazet
2026-11-17 23:44 ` Kuniyuki Iwashima
2026-11-17 5:35 ` [PATCH v1 net 5/8] tcp: Check ip_sk_accept_pmtu() in tcp_v4_err() Kuniyuki Iwashima
2026-11-17 8:54 ` Eric Dumazet
2026-11-17 5:35 ` [PATCH v1 net 6/8] selftest: net: packetdrill: Add ICMP and ICMPv6 tests Kuniyuki Iwashima
2026-11-17 8:58 ` Eric Dumazet
2026-11-17 23:45 ` Kuniyuki Iwashima [this message]
2026-11-17 5:35 ` [PATCH v1 net 7/8] tcp: Pass inet_sdif() to __inet_lookup_established() in tcp_v4_err() Kuniyuki Iwashima
2026-11-17 9:01 ` Eric Dumazet
2026-11-17 5:35 ` [PATCH v1 net 8/8] tcp: Pass inet6_iif() to __inet6_lookup_established() in tcp_v6_err() Kuniyuki Iwashima
2026-11-17 9:03 ` Eric Dumazet
2026-11-17 23:56 ` Kuniyuki Iwashima
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=avzm6dKfqvyPgTC_@google.com \
--to=kuniyu@google.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuni1840@gmail.com \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.