On 10/10/23 10:00 AM, Kuniyuki Iwashima wrote:
+__bpf_kfunc int bpf_sock_addr_set_unix_addr(struct bpf_sock_addr_kern *sa_kern,
+ const u8 *addr, u32 addrlen__sz)
I'd rename addrlen__sz to sun_path_len or something else because the
conventional addrlen for AF_UNIX contains offsetof(struct sockaddr_un,
sun_path).
The "__sz" suffix is required by the verifier. It is the size of the preceding
argument "addr". While at it, addrlen__sz should be just "addr__sz" (or
sun_path__sz, depending on what name is decided here) for consistency with other
kfunc.
I don't have strong preference on the argument name. However, if it is
sun_path__sz, then the preceding argument should be renamed to "sun_path" also
for consistency reason and then the kfunc should probably be renamed to
bpf_sock_addr_set_sun_path.