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)
Tue, May 7, 9:05 AM
Unknown Object (File)
Thu, May 2, 9:43 PM
Unknown Object (File)
Sun, Apr 28, 2:54 AM
Unknown Object (File)
Sat, Apr 27, 5:24 AM
Unknown Object (File)
Sat, Apr 27, 12:48 AM
Unknown Object (File)
Fri, Apr 26, 11:38 PM
Unknown Object (File)
Fri, Apr 26, 9:28 PM
Unknown Object (File)
Fri, Apr 26, 4:17 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 56674
Build 53562: arc lint + arc unit

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