Skip to content

testing/nettest: Test short IPv6 multicast options. - #4150

Open
casaroli wants to merge 1 commit into
apache:masterfrom
casaroli:sockopt-ipv6-len-up
Open

casaroli wants to merge 1 commit into
apache:masterfrom
casaroli:sockopt-ipv6-len-up

Conversation

@casaroli

@casaroli casaroli commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

test_mcast_optlen_ipv6 of cmocka_net_mcast now also checks IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP with an option one byte shorter than struct ipv6_mreq, and IPV6_MULTICAST_IF with an option one byte shorter than an int. Each call must fail with EINVAL, as MCAST_JOIN_GROUP does.

Impact

Test only. Without apache/nuttx#22376 the case fails: the kernel accepts the short options.

Testing

cmocka_net_mcast on sim:nsh with IPv6, UDP, loopback, ICMPv6 and MLD (CI image, apps with the new checks):

master 28db4789c34 this PR
test_mcast_optlen_ipv6 FAIL: 0 != -1 at test_mcast_ipv6.c:211 (the short IPV6_JOIN_GROUP succeeds) pass
other 5 cases pass pass

@casaroli
casaroli marked this pull request as ready for review November 26, 2026 14:38
@anjiahao1

Copy link
Copy Markdown
Contributor

This CI failure is not caused by the nettest change. The sim-03 job builds the apps tree from this PR's test-merge commit (bace6f5), which was created before testing/fs/wzipfs landed in master. The job does fetch current nuttx master, where the zipfs defconfig now enables CONFIG_TESTING_WZIPFS, so the defconfig normalization reports:

  81d80
  < CONFIG_TESTING_WZIPFS=y

A rebase, or any new push, regenerates the merge commit against current master and clears it. No code change is needed in this PR.

test_mcast_optlen_ipv6 now also gives IPV6_JOIN_GROUP and
IPV6_LEAVE_GROUP an option one byte shorter than struct ipv6_mreq, and
IPV6_MULTICAST_IF an option one byte shorter than an int.  Each call
must fail with EINVAL, as MCAST_JOIN_GROUP does.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
@casaroli
casaroli force-pushed the sockopt-ipv6-len-up branch from 6c13c1c to 7634bca Compare November 27, 2026 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants