HomeFreeBSD

linux: make linux_netlink_p->msg_from_linux be able to fail

Description

linux: make linux_netlink_p->msg_from_linux be able to fail

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 header, pass hdr as pointer to pointer.

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.

PR: 274536
Reviewed by: melifaro
Differential Revision: https://reviews.freebsd.org/D44392

Details

Provenance
glebiusAuthored on Mar 29 2024, 8:35 PM
Reviewer
melifaro
Differential Revision
D44392: linux: make linux_netlink_p->msg_from_linux be able to fail
Parents
rG9d4a08d162d8: linux: use sa_family_t for address family conversions
Branches
Unknown
Tags
Unknown