[Bug 281990] offset of sa_family in sockaddr_ib inconsistent with sockaddr

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 11 Oct 2024 13:06:26 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281990

--- Comment #5 from Mark Johnston <markj@FreeBSD.org> ---
(In reply to Konstantin Belousov from comment #4)
In general, our generic system calls do not require userspace to fill out
sa_len.  Consumers should use getsockaddr(), which fills it in.

The kernel's use of sockaddr_ib appears to be mostly contained within the rdma
connection manager, where the sockaddr length can be inferred from sa_family. 
So it may not even be necessary to fill out the length anywhere, just reserve
the first byte of the struct as a pad byte.  I do not see why it would be
source-incompatible with Linux, all of the references to sib_family in the tree
are just assignments.  It shouldn't matter whether the field is a uint8_t vs. a
uint16_t, so I don't see code changes are required.

Alternately, OFED code could be compiled with a sockaddr definition that is
compatible with Linux.

-- 
You are receiving this mail because:
You are the assignee for the bug.