[PATCH 0/1] MR3403: server: Revert "server: Avoid using SOL_IPX to detect whether IPX is supported."
This reverts commit 41cc117b3f37ab4b9b4ac8a815cd2a496d38fb4b. This commit broke musl support. With the changes introduced, the following code evaluates to the #else branch without checking for SO_DEFAULT_HEADERS resulting in an error. server/sock.c +1888 ``` \#ifdef HAS_IPX int ipx_type = protocol - WS_NSPROTO_IPX; \#ifdef SOL_IPX setsockopt( sockfd, SOL_IPX, IPX_TYPE, &ipx_type, sizeof(ipx_type) ); \#else struct ipx val; /* Should we retrieve val using a getsockopt call and then * set the modified one? */ val.ipx_pt = ipx_type; setsockopt( sockfd, 0, SO_DEFAULT_HEADERS, &val, sizeof(val) ); \#endif \#endif ``` I propose reverting the commit, but we could probably alter the macro in the code section provided to match the changes relevant github issue: https://github.com/void-linux/void-packages/pull/45202 Signed-off-by: Fotios Valasiadis <fvalasiad(a)gmail.com> -- https://gitlab.winehq.org/wine/wine/-/merge_requests/3403
From: Fotios Valasiadis <fvalasiad(a)gmail.com> This reverts commit 41cc117b3f37ab4b9b4ac8a815cd2a496d38fb4b. This commit broke musl support. With the changes introduced, the following code evaluates to the #else branch without checking for SO_DEFAULT_HEADERS resulting in an error. server/sock.c +1888 ``` \#ifdef HAS_IPX int ipx_type = protocol - WS_NSPROTO_IPX; \#ifdef SOL_IPX setsockopt( sockfd, SOL_IPX, IPX_TYPE, &ipx_type, sizeof(ipx_type) ); \#else struct ipx val; /* Should we retrieve val using a getsockopt call and then * set the modified one? */ val.ipx_pt = ipx_type; setsockopt( sockfd, 0, SO_DEFAULT_HEADERS, &val, sizeof(val) ); \#endif \#endif ``` I propose reverting the commit, but we could probably alter the macro in the code section provided to match the changes relevant github issue: https://github.com/void-linux/void-packages/pull/45202 Signed-off-by: Fotios Valasiadis <fvalasiad(a)gmail.com> --- server/sock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/sock.c b/server/sock.c index 550fe61e477..4fe57dd8495 100644 --- a/server/sock.c +++ b/server/sock.c @@ -62,7 +62,6 @@ #ifdef HAVE_NETIPX_IPX_H # include <netipx/ipx.h> -# define HAS_IPX #elif defined(HAVE_LINUX_IPX_H) # ifdef HAVE_ASM_TYPES_H # include <asm/types.h> @@ -71,6 +70,8 @@ # include <linux/types.h> # endif # include <linux/ipx.h> +#endif +#if defined(SOL_IPX) || defined(SO_DEFAULT_HEADERS) # define HAS_IPX #endif -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/3403
Commit 41cc117b3f37ab4b9b4ac8a815cd2a496d38fb4b is from MR !2965, which fixes building with bionic libc:
4.18+ Linux kernels remove support for IPX but keep SOL_IPX defined, which causes compilation errors as wine unconditionally uses IPX structures if this is the case. Instead check for IPX_MTU to determine IPX support as it is defined within the ipx.h header itself.
Maybe the check can be made stricter in a way that allows both musl and bionic. Alternatively, we can just test for `struct sockaddr_ipx` in autoconf. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/3403#note_40149
On Tue Jul 25 13:31:47 2023 +0000, Jinoh Kang wrote:
Commit 41cc117b3f37ab4b9b4ac8a815cd2a496d38fb4b is from MR !2965, which fixes building with bionic libc:
4.18+ Linux kernels remove support for IPX but keep SOL_IPX defined, which causes compilation errors as wine unconditionally uses IPX structures if this is the case. Instead check for IPX_MTU to determine IPX support as it is defined within the ipx.h header itself. Maybe the check can be made stricter in a way that allows both musl and bionic. Alternatively, we can just test for `struct sockaddr_ipx` in autoconf. Hmmm we could modify the macros in place by replacing "#else"(line 1884) with "#elif defined(SO_DEFAULT_HEADERS)"
That way musl would work too, what do you think? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/3403#note_40151
On Tue Jul 25 13:31:47 2023 +0000, Fotios Valasiadis wrote:
Hmmm we could modify the macros in place by replacing "#else"(line 1884) with "#elif defined(SO_DEFAULT_HEADERS)" That way musl would work too, what do you think? Sounds great. That'll also make `server/sock.c` consistent with `dlls/ntdll/unix/socket.c` in terms of `SO_DEFAULT_HEADERS` usage.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/3403#note_40152
participants (3)
-
Fotios Valasiadis -
Fotios Valasiadis (@fvalasiad) -
Jinoh Kang (@iamahuman)