Page MenuHomeFreeBSD

netinet6: Pass IPv4-mapped ASM multicast joins/leaves to netinet.
Needs ReviewPublic

Authored by bms on Sun, Feb 1, 4:56 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Feb 2, 4:33 PM
Unknown Object (File)
Mon, Feb 2, 3:31 PM
Unknown Object (File)
Mon, Feb 2, 3:14 PM
Unknown Object (File)
Mon, Feb 2, 2:44 PM
Unknown Object (File)
Mon, Feb 2, 8:33 AM

Details

Reviewers
bz
hrs
glebius
kp
Summary

Return EAFNOSUPPORT for non-IPv6 addresses in mcast sockopts.
Add comment about future IPv4 source-address selection support.

This has been compile tested with LINT and LINT-NOINET,
but has not yet been runtime tested.

Inspired by: xnu (Clean-roomed from APSL change)
PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=193246

Test Plan

Kyua tests will follow in a separate commit. I note that not all of the legacy IP multicast regression tests were ported to ATF over the years.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 70313
Build 67196: arc lint + arc unit

Event Timeline

bms requested review of this revision.Sun, Feb 1, 4:56 AM
bms edited the test plan for this revision. (Show Details)
bms added reviewers: bz, hrs, glebius, kp.

The IPv4 mapped behaviour is limited to ASM memberships only, and is not directly mandated by an RFC. The comments around in6u_lookup_v4mapped_mc() reflect this-- it's something that has seen wider use than one would anticipate, despite it being kind of dog stupid to do IPv4 operations on an IPv6 socket.

This revision is also missing a man page update. Historically Pavlin Radoslavov has handled the multicast routing end of things, here it needs to go in ip6(4).

@bz: The Apple xnu code has cleaned up scope ID handling, so that may be
worth abridging from also. They added scope checks to im6o_mc_filter(), conditionalised on their own in6_embedded_scope global.

They renamed in6_joingroup_locked() to in6_mc_join() which is a little confusing, and it looks like they demoted the per-socket SSM filters from an RB-tree to a growable array. That I can understand; stuff gets merged into the stack-wide RB-tree for each group anyway.

However I didn't check what changes they may have made to imo_multi_filter(), yet.

OT: Apple do not provide meaningful change history in their xnu drops on GitHub, which is extremely inconvenient.

OT: I am in touch separately with core-secretary@ to open a dialogue about regaining full commit access after a 7.5 year hiatus for health & bereavement reasons.

Bruce, very glad to see you back!!!

sys/netinet6/in6_mcast.c
1462

I'd suggest to commit all of the changes from EINVALs to EAFNOSUPPORT as a separate commit.

1894

Let's spell as AF_INET6 for consistency.

1899

What does letter u in in6u_ stands for?

1918

IMHO, this macro should go away. We should search for first AF_INET address on the list of addresses of the given interface instead of searching on the global list. btw, this macro is used only in multicast related code.

You may want to add the suggested code as a function, e.g. in_firstaddr() and place it in in.c next to in_ifhasaddr().

1996–2002

This all can be a static initializer.

2004

Let's add brackets per style(9).

2336–2342

Can be static initializer.

2339

Is the void cast needed at all?

2344

Let's add brackets per style(9).

2353

Why do we need these extra braces?