Page MenuHomeFreeBSD

linux: use sa_family_t for address family conversions
ClosedPublic

Authored by glebius on Mar 15 2024, 6:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 7, 6:56 AM
Unknown Object (File)
Sun, Apr 5, 11:22 AM
Unknown Object (File)
Sun, Apr 5, 10:09 AM
Unknown Object (File)
Tue, Mar 24, 4:22 AM
Unknown Object (File)
Mar 20 2026, 3:44 AM
Unknown Object (File)
Mar 18 2026, 1:52 PM
Unknown Object (File)
Mar 17 2026, 7:43 PM
Unknown Object (File)
Mar 15 2026, 4:32 AM
Subscribers

Details

Summary

Express "conversion failed" with maximum possible value. This allows to
reduce number of size/signedness conversion in the code that utilizes the
functions.

PR: 274536 (related)

Diff Detail

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

Event Timeline

trasz added inline comments.
sys/compat/linux/linux_netlink.c
109 ↗(On Diff #135794)

Is this bit supposed to be here? Looks like it's some routing table index, not an address family?

sys/compat/linux/linux_netlink.c
109 ↗(On Diff #135794)

AFAIU, the (int)-1 returned by linux_to_bsd_domain() would convert into 255 when assigned to (unsigned char)rtm->rtm_table. Thus, 254 seems like a typo to me. I can separate that into a single commit.

Remove rt_table change. It is unrelated.

This revision is now accepted and ready to land.Mar 29 2024, 7:31 PM