Page MenuHomeFreeBSD

linux: make linux_netlink_p->msg_from_linux be able to fail
ClosedPublic

Authored by glebius on Mar 16 2024, 4:20 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jan 12, 4:51 PM
Unknown Object (File)
Thu, Dec 25, 9:14 PM
Unknown Object (File)
Dec 22 2025, 3:38 PM
Unknown Object (File)
Dec 20 2025, 12:18 AM
Unknown Object (File)
Dec 16 2025, 11:26 PM
Unknown Object (File)
Dec 16 2025, 8:48 AM
Unknown Object (File)
Dec 14 2025, 2:59 PM
Unknown Object (File)
Dec 14 2025, 2:30 AM

Details

Summary

The KPI for this function was misleading. From the NetLink perspective it
looked like a function that: a) allocates new hdr, b) can fail. Neither
was true. Let the function return a error code instead of returning the
same hdr it was passed to. In case if future Linux NetLink compatibility
support calls for reallocating hdr, we can change KPI to pass struct nlmsg
hdr **.

With KPI that returns a error, propagate domain conversion errors all the
way up to NetLink module. This fixes panic when unknown domain is
converted to 0xff and this invalid value is passed into NetLink
processing.

Diff Detail

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

Event Timeline

Add family check to rtnl_route_from_linux(). The strange manipulation with
rt_table blinded me and I didn't notice rt_family going unchecked.

Pass hdr as pointer to pointer.

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

Apologizes for bumping this review. I've realized that this was most likely an inappropriate place to send my message, and have thusly switched over to the freebsd-emulation mailing list.