xdp-trafficgen fails to build against musl libc
nekopsykose opened this issue · comments
on 1.4.0
xdp-trafficgen.c:793:33: error: passing argument 2 of 'getsockname' from incompatible pointer type [-Werror=incompatible-pointer-types]
793 | err = getsockname(sock, &local_saddr, &sockaddr_sz);
| ^~~~~~~~~~~~
| |
| struct sockaddr_in6 *
this is probably because local_saddr is sockaddr_in6 but getsockname takes struct sockaddr as documented. theoretically these are different pointers..
it's possible to get around this by casting it, but afaik that is still a strict aliasing violation (maybe?) so it would only be safe with -fno-strict-aliasing
Hmm. I don't have any issue with adding a cast to appease musl - let's see if that is sufficient. Could you please see if #350 fixes the issue for you?
that fixes it, yeah
asked in #musl
irc and you are actually supposed to cast it, so that is actually the correct solution and my analysis that it could be wrong, was wrong :)
thanks for the fix