Page MenuHomeFreeBSD

netinet tests: Add test for IPv6 mapped-v4 bind problem
ClosedPublic

Authored by karels on Aug 6 2022, 2:38 PM.
Tags
None
Referenced Files
F110219799: D36056.diff
Sat, Feb 15, 7:15 AM
Unknown Object (File)
Mon, Feb 10, 6:37 AM
Unknown Object (File)
Dec 9 2024, 1:56 PM
Unknown Object (File)
Dec 8 2024, 2:59 AM
Unknown Object (File)
Nov 5 2024, 10:02 PM
Unknown Object (File)
Oct 6 2024, 5:07 PM
Unknown Object (File)
Oct 3 2024, 12:14 AM
Unknown Object (File)
Sep 17 2024, 6:21 PM

Details

Summary

Test fix in 637f317c6d9c, verifying that when ports run out, we get
an EADDRNOTAVAIL error from bind() rather than an EADDRINUSE error
from connect(). Use small port range to exhaust ports and see which
error happens.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 46763
Build 43652: arc lint + arc unit

Event Timeline

Nit: it may be worth considering using some of the https://cgit.freebsd.org/src/tree/tests/sys/net/routing/test_rtsock_lladdr.c infra, which spawns/destroys VNET jail on per-test basis.
This approach avoids all sysctl side effects and removes the need to save/restore sysctl variables.

Thanks for pointing out the jail support for routing tests. If I were starting from scratch, I would certainly consider it. However, having already gotten this working with sysctl save/restore, I'm not sure there is much win in switching. The jail (and interface) setup is much heavier-weight, and I'd be concerned about what else is pulled in. As it was, tcp_connect_port_test.c was a good model for what I wanted to do.

tests/sys/netinet/Makefile
18

Since you decided not go to with VNETs and modify global sysctls, you should add:

TEST_METADATA.tcp6_v4mapped_bind_test+=      is_exclusive="true"

Otherwise later some other test may start to fail randomly in massive testing runs and it is going to be hard to figure our why.

Make tcp6_v4mapped_bind_test exclusive.

karels added inline comments.
tests/sys/netinet/Makefile
18

Thanks, I didn't know about is_exclusive.

Any comments or approvals from transport ? It is blocking.

This revision is now accepted and ready to land.Aug 8 2022, 1:27 PM