Page MenuHomeFreeBSD

mtest: Add support for exercising IPv4-mapped groups on IPv6 sockets.
ClosedPublic

Authored by bms on Sun, Aug 2, 8:01 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Aug 26, 4:08 PM
Unknown Object (File)
Wed, Aug 26, 3:59 PM
Unknown Object (File)
Wed, Aug 26, 9:55 AM
Unknown Object (File)
Sun, Aug 23, 10:04 PM
Unknown Object (File)
Sun, Aug 23, 9:28 PM
Unknown Object (File)
Fri, Aug 21, 11:09 AM
Unknown Object (File)
Fri, Aug 21, 4:57 AM
Unknown Object (File)
Wed, Aug 19, 11:50 AM
Subscribers

Details

Summary

This is a temporary substitute for al Kyua/ATF regression test.

This remains an optional feature that was beyond the scope of IETF's normative references for IPv6
multicast; support has been strictly on a best-effort basis.

Two new commands are added to mtest(8):
u mcast-addr ifname - join IPv4-mapped group on IPv6 socket
v mcast-addr ifname - leave IPv4-mapped group on IPv6 socket

Add an internal helper function in6_v4_to_v4mapped() to perform the
converse of the IN6_IS_ADDR_V4MAPPED() check to support this use case.
Whilst
in6_v4_to_v4mapped() returns its first argument as a convenience,
avoid the temptation to dereference a pointer to that which we already hold.

Strictly the use of sockunion_t within mtest(8) more generally is a form
of controlled type punning (aliasing). Use a temporary as we overwrite
contents of su; the resultant write would overlap memory locations.

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=193246

Test Plan

This IS part of the test plan for D58585.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bms requested review of this revision.Sun, Aug 2, 8:01 AM
bms created this revision.
This comment was removed by bms.
bms edited the summary of this revision. (Show Details)
bms added a subscriber: network.

I added ntohl() to the corresponding kernel path for conversion from v6 to v4 sockopts, as was done for the 0xFFFF interstitial value normally found in IPv4-mapped addresses. This seems to be due to how values are assigned to s6_addr32[] array members.

When debugging, the macro alias is not available, and the underlying u6_addr.u6_addr32 member must be used instead.

Pardon my English knowledge. Does "in lieu of" mean "instead of", or "before"? IMHO, the test for the new functionality should be added to the main Kyua testsuite, so that it is checked routinely by our CI (or external CIs). There is not connection between standardization and requirement for tests. I can point at hundreds of test cases in tests/sys that test something that is not covered by RFC, POSIX or anything else. It is just the desired behavior that we want to preserve.

@glebius "In lieu of" is typically taken to mean "instead of", "in place of", "with respect to". I was hoping to delegate Kyua-ifying the test to another volunteer so I can defer having to deal with Kyua upfront right now and keep the momentum, but if you insist, I guess we will have to do it that way.

Can we at least land the other revisions before I proceed with that?

I would in any case have to get familiar with Kyua anyway for landing other code. I have sys/crypto and sys/opencrypto in my sights.

bms edited the summary of this revision. (Show Details)
This revision was not accepted when it landed; it landed in state Needs Review.Mon, Aug 3, 3:48 PM
This revision was automatically updated to reflect the committed changes.