[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e68843a2-632c-4703-8a75-551c56232224@redhat.com>
Date: Tue, 3 Feb 2026 11:07:48 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: Tom Herbert <tom@...bertland.com>, davem@...emloft.net, kuba@...nel.org,
netdev@...r.kernel.org, justin.iurman@...ege.be,
willemdebruijn.kernel@...il.com
Subject: Re: [PATCH net-next v6 10/10] test: Add networking sefltest for eh
limits
On 2/3/26 1:48 AM, Tom Herbert wrote:
> Add a networking selftest for Extension Header limits. The
> limits to test are in systcls:
>
> net.ipv6.enforce_ext_hdr_order
> net.ipv6.max_dst_opts_number
> net.ipv6.max_hbh_opts_number
> net.ipv6.max_hbh_length
> net.ipv6.max_dst_opts_length
>
> The basic idea of the test is to fabricate ICMPv6 Echo Request
> packets with various combinations of Extension Headers. The packets
> are sent to a host in another namespace. If a an ICMPv6 Echo Reply
> is received then the packet wasn't dropped due to a limit being
> exceeded, and if it was dropped then we assume that a limit was
> exceeded. For each test packet we derive an expectation as to
> whether the packet will be dropped or not. Test success depends
> on whether our expectation is matched. i.e. if we expect a reply
> then the test succeeds if we see a reply, and if we don't expect a
> reply then the test succeeds if we don't see a reply.
>
> The test is divided into a frontend bash script (eh_limits.sh) and a
> backend Python script (eh_limits.py).
>
> The frontend sets up two network namespaces with IPv6 addresses
> configured on veth's. We then invoke the backend to send the
> test packets. This first pass is done with default sysctl settings.
> On a second pass we change the various sysctl settings and run
> again.
>
> The backend runs through the various test cases described in the
> Make_Test_Packets function. This function calls Make_Packet for
> a test case where arguments provide the Extension Header chain to
> be tested. The Run_Test function loops through the various packets
> and tests if a reply is received versus the expectation. If a test
> case fails then an error status is returned by the backend.
>
> The backend script can also be run with the "-w <pcap_file>" to
> write the created packets to a pcap file instead of running the
> test.
>
> Signed-off-by: Tom Herbert <tom@...bertland.com>
> ---
> tools/testing/selftests/net/Makefile | 1 +
> tools/testing/selftests/net/eh_limits.py | 352 +++++++++++++++++++++++
> tools/testing/selftests/net/eh_limits.sh | 205 +++++++++++++
> 3 files changed, 558 insertions(+)
> create mode 100755 tools/testing/selftests/net/eh_limits.py
> create mode 100755 tools/testing/selftests/net/eh_limits.sh
>
> diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile
> index afdea6d95bde..73195a2e8f1e 100644
> --- a/tools/testing/selftests/net/Makefile
> +++ b/tools/testing/selftests/net/Makefile
> @@ -24,6 +24,7 @@ TEST_PROGS := \
> cmsg_time.sh \
> double_udp_encap.sh \
> drop_monitor_tests.sh \
> + eh_limits.sh \
> fcnal-ipv4.sh \
> fcnal-ipv6.sh \
> fcnal-other.sh \
> diff --git a/tools/testing/selftests/net/eh_limits.py b/tools/testing/selftests/net/eh_limits.py
> new file mode 100755
> index 000000000000..01fcf15c6b94
> --- /dev/null
> +++ b/tools/testing/selftests/net/eh_limits.py
> @@ -0,0 +1,352 @@
> +#!/usr/bin/env python3
> +# SPDX-License-Identifier: GPL-2.0
> +
> +# Test of extension header limits
> +
> +import ext_hdr
> +import getopt
> +import proto_nums
> +import shlex
> +
> +from scapy.all import *
Not a real review yet, but this is causing self-test failure, because
scapy is not available/installed in our runners.
To prevent such failures you should add:
require_command scapy
in the test shell script.
Also please be aware that CI runs linters vs python and shell code, and
there are quite a few complains with them. You can use the
`ingest_mdir.py` tool from:
https://github.com/linux-netdev/nipa/blob/main/ingest_mdir.py
to automate the pre-submit checks.
Thanks,
Paolo
Powered by blists - more mailing lists