Page MenuHomeFreeBSD

in6.h: expose s6_addr* definitions to user level
ClosedPublic

Authored by karels on Fri, Apr 26, 10:18 PM.
Tags
None
Referenced Files
F83294750: D44979.diff
Wed, May 8, 1:17 PM
Unknown Object (File)
Sun, May 5, 5:57 PM
Unknown Object (File)
Sun, Apr 28, 11:24 PM
Unknown Object (File)
Sat, Apr 27, 8:19 AM
Unknown Object (File)
Sat, Apr 27, 6:55 AM
Unknown Object (File)
Sat, Apr 27, 6:52 AM
Unknown Object (File)
Fri, Apr 26, 10:21 PM

Details

Summary

The only element of of in6_addr that is specified in RFC 3493 or
in POSIX.1-2017 is s6_addr, implemented via a #define to a union
member. However, FreeBSD and other BSD systems have additional
definitions for the other union members, s6_addr{8,16,32} which
are defined for the kernel and loader. Some Linux applications
also use them, and they seem to be allowed by the RFC and POSIX.
Remove the current ifdefs, exposing the additional fields to user
level, and replace with #if __BSD_VISIBLE. Add an explanatory
comment expanding on the previous "nonstandard" comment.

MFC after: 1 week

Diff Detail

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

Event Timeline

sys/netinet6/in6.h
103–109

I added __BSD_VISIBLE to the end of the prior #if so we don't pollute the namespace too much for strict environments.

zlei added inline comments.
sys/netinet6/in6.h
103–109

I added __BSD_VISIBLE to the end of the prior #if so we don't pollute the namespace too much for strict environments.

+1 for __BSD_VISIBLE.

sys/netinet6/in6.h
103–109

Yes, I think __BSD_VISIBLE is more consistent with the rest of the file, if not strictly required. However, I don't think "defined(_KERNEL) || defined(_STANDALONE)" are needed along with __BSD_VISIBLE, are they?

sys/netinet6/in6.h
103–109

Just __BSd_VISIBLE is fine I think and I'd happily accept that.

sys/netinet6/in6.h
103–109

Warner, agree? You mentioned adding it on.

Yes. I agree. It will be defined for both kernel and loader builds.

Might want to do an expbuild too since its a user visible change

This revision is now accepted and ready to land.Sat, Apr 27, 8:21 PM