diff --git a/pkgs/by-name/so/socat/musl.patch b/pkgs/by-name/so/socat/musl.patch new file mode 100644 index 000000000000..9ec957b4d8c2 --- /dev/null +++ b/pkgs/by-name/so/socat/musl.patch @@ -0,0 +1,46 @@ +From 8be51b7c3520fd2dbd1ba2e917a499c90822817f Mon Sep 17 00:00:00 2001 +From: Alyssa Ross +Date: Tue, 27 Jan 2026 10:46:19 +0100 +Subject: [PATCH] Fix build for musl +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +musl's struct msghdr includes padding members, so using undesignated +initializers as was previously being done ended up initializing the +wrong members: + + gcc -O -D_GNU_SOURCE -Wall -Wno-parentheses -DHAVE_CONFIG_H -I. -I. -c -o xio-netlink.o xio-netlink.c + xio-netlink.c: In function ‘xio_netlink_mtu’: + xio-netlink.c:33:59: error: initialization of ‘int’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion] + 33 | ct msghdr rtmsg = { &sa, sizeof(sa), &iov, 1, NULL, 0, 0 }; + | ^~~~ + xio-netlink.c:33:59: note: (near initialization for ‘rtmsg.__pad1’) + make: *** [: xio-netlink.o] Error 1 +--- + xio-netlink.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/xio-netlink.c b/xio-netlink.c +index 533d78c..b0c5c3c 100644 +--- a/xio-netlink.c ++++ b/xio-netlink.c +@@ -30,7 +30,12 @@ int xio_netlink_mtu( + struct nlmsghdr buf[8192/sizeof(struct nlmsghdr)]; + struct iovec iov = { buf, sizeof(buf) }; + struct sockaddr_nl sa; +- struct msghdr rtmsg = { &sa, sizeof(sa), &iov, 1, NULL, 0, 0 }; ++ struct msghdr rtmsg = { ++ .msg_name = &sa, ++ .msg_namelen = sizeof(sa), ++ .msg_iov = &iov, ++ .msg_iovlen = 1, ++ }; + struct nlmsghdr *nh; + + Info2("Setting interface %d MTU to %u using netlink", interface_index, mtu); + +base-commit: 8834d6cc7e0d7b04cd31f9f7d0cb3e06913b0323 +-- +2.52.0 + diff --git a/pkgs/by-name/so/socat/package.nix b/pkgs/by-name/so/socat/package.nix index f3e1774f6c48..e5fef5ff3227 100644 --- a/pkgs/by-name/so/socat/package.nix +++ b/pkgs/by-name/so/socat/package.nix @@ -11,13 +11,17 @@ stdenv.mkDerivation rec { pname = "socat"; - version = "1.8.0.3"; + version = "1.8.1.0"; src = fetchurl { url = "http://www.dest-unreach.org/socat/download/${pname}-${version}.tar.bz2"; - hash = "sha256-AesBc2HZW7OmlB6EC1nkRjo/q/kt9BVO0CsWou1qAJU="; + hash = "sha256-kfIi7mVVkDZgDCUFuZms6+1IuJnw4uU64cnDHWmGtqQ="; }; + patches = [ + ./musl.patch + ]; + postPatch = '' patchShebangs test.sh substituteInPlace test.sh \