git: ea390ec31eb6 - main - tests/netinet/ip_reass: skip when IP reassembly is disabled
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 16 Nov 2026 20:18:54 UTC
The branch main has been updated by glebius:
URL: https://cgit.FreeBSD.org/src/commit/?id=ea390ec31eb6114296ae3e64ac8ea4d7bf0a707d
commit ea390ec31eb6114296ae3e64ac8ea4d7bf0a707d
Author: Nick Banks <nickbanks@netflix.com>
AuthorDate: 2026-11-16 18:53:40 +0000
Commit: Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2026-11-16 20:18:41 +0000
tests/netinet/ip_reass: skip when IP reassembly is disabled
---
tests/sys/netinet/ip_reass_test.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/tests/sys/netinet/ip_reass_test.c b/tests/sys/netinet/ip_reass_test.c
index e32fb63f34da..84f6b7e9db14 100644
--- a/tests/sys/netinet/ip_reass_test.c
+++ b/tests/sys/netinet/ip_reass_test.c
@@ -172,6 +172,20 @@ open_lobpf(in_addr_t *addrp)
return (fd);
}
+static void
+require_reass(void)
+{
+ size_t len;
+ int max;
+
+ len = sizeof(max);
+ ATF_REQUIRE(sysctlbyname("net.inet.ip.maxfragpackets", &max, &len,
+ NULL, 0) == 0);
+ if (max == 0)
+ atf_tc_skip("IP reassembly is disabled "
+ "(net.inet.ip.maxfragpackets=0)");
+}
+
static void
get_ipstat(struct ipstat *stat)
{
@@ -210,6 +224,7 @@ ATF_TC_BODY(ip_reass__multiple_last_fragments, tc)
int error, fd;
uint16_t ipid;
+ require_reass();
fd = open_lobpf(&addr);
ipid = arc4random_uniform(UINT16_MAX + 1);
@@ -290,6 +305,7 @@ ATF_TC_BODY(ip_reass__zero_length_fragment, tc)
int error, fd;
uint16_t ipid;
+ require_reass();
fd = open_lobpf(&addr);
ipid = arc4random_uniform(UINT16_MAX + 1);
@@ -340,6 +356,7 @@ ATF_TC_BODY(ip_reass__large_fragment, tc)
int error, fd;
uint16_t ipid;
+ require_reass();
fd = open_lobpf(&addr);
ipid = arc4random_uniform(UINT16_MAX + 1);