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
Unknown Object (File)
Jan 17 2024, 8:48 PM
Unknown Object (File)
Jan 12 2024, 6:56 AM
Unknown Object (File)
Dec 22 2023, 10:04 PM
Unknown Object (File)
Nov 9 2023, 10:48 PM
Unknown Object (File)
Nov 7 2023, 11:00 PM
Unknown Object (File)
Oct 26 2023, 5:09 AM
Unknown Object (File)
Oct 6 2023, 9:44 PM
Unknown Object (File)
Sep 14 2023, 8:31 AM

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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

karels requested review of this revision.Aug 6 2022, 2:38 PM

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–19

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–19

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