diff mbox series

[v2] socat: 1.8.0.3 -> 1.8.1.0

Message ID 20251217052747.1182612-1-hongxu.jia@windriver.com
State New
Headers show
Series [v2] socat: 1.8.0.3 -> 1.8.1.0 | expand

Commit Message

Hongxu Jia Dec. 17, 2025, 5:27 a.m. UTC
Fix compile failed with musl

License-Update: No change, update README to add new lines

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 .../0001-fix-compile-failed-with-musl.patch   | 42 +++++++++++++++++++
 .../{socat_1.8.0.3.bb => socat_1.8.1.0.bb}    |  5 ++-
 2 files changed, 45 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-connectivity/socat/files/0001-fix-compile-failed-with-musl.patch
 rename meta/recipes-connectivity/socat/{socat_1.8.0.3.bb => socat_1.8.1.0.bb} (88%)
diff mbox series

Patch

diff --git a/meta/recipes-connectivity/socat/files/0001-fix-compile-failed-with-musl.patch b/meta/recipes-connectivity/socat/files/0001-fix-compile-failed-with-musl.patch
new file mode 100644
index 0000000000..47ca6b97b0
--- /dev/null
+++ b/meta/recipes-connectivity/socat/files/0001-fix-compile-failed-with-musl.patch
@@ -0,0 +1,42 @@ 
+From baf05d4c74d35a98d65328b89627d1806bfd84a5 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 17 Dec 2025 11:31:29 +0800
+Subject: [PATCH] fix compile failed with musl
+
+...
+|../sources/socat-1.8.1.0/xio-netlink.c:33:59: error: initialization of 'int' from 'void *' makes integer from pointer without a cast [-Wint-conversion]
+|   33 |         struct msghdr rtmsg = { &sa, sizeof(sa), &iov, 1, NULL, 0, 0 };
+|      |                                                           ^~~~
+...
+
+The warning is due to the fact the NULL macro is defined (by most modern
+compilers) as ((void *)0), as it is intended to be used only for pointers.
+Assigning this value to the void *msg_control member of structure msghdr
+causes the warning.
+
+To remove this warning, use 0 in place of NULL;
+
+Refer https://stackoverflow.com/questions/64535635/assignment-to-int-from-void-makes-integer-from-pointer-without-a-cast
+
+Upstream-Status: Submitted [socat@dest-unreach.org]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ xio-netlink.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/xio-netlink.c b/xio-netlink.c
+index 533d78c..cb31c43 100644
+--- a/xio-netlink.c
++++ b/xio-netlink.c
+@@ -30,7 +30,7 @@ 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 = { &sa, sizeof(sa), &iov, 1, 0, 0, 0 };
+ 	struct nlmsghdr *nh;
+ 
+ 	Info2("Setting interface %d MTU to %u using netlink", interface_index, mtu);
+-- 
+2.49.0
+
diff --git a/meta/recipes-connectivity/socat/socat_1.8.0.3.bb b/meta/recipes-connectivity/socat/socat_1.8.1.0.bb
similarity index 88%
rename from meta/recipes-connectivity/socat/socat_1.8.0.3.bb
rename to meta/recipes-connectivity/socat/socat_1.8.1.0.bb
index b5f5d72f9c..331133d6f9 100644
--- a/meta/recipes-connectivity/socat/socat_1.8.0.3.bb
+++ b/meta/recipes-connectivity/socat/socat_1.8.1.0.bb
@@ -7,13 +7,14 @@  SECTION = "console/network"
 
 LICENSE = "GPL-2.0-with-OpenSSL-exception"
 LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
-                    file://README;beginline=248;endline=278;md5=338c05eadd013872abb1d6e198e10a3f"
+                    file://README;beginline=252;endline=282;md5=338c05eadd013872abb1d6e198e10a3f"
 
 SRC_URI = "http://www.dest-unreach.org/socat/download/socat-${PV}.tar.bz2 \
            file://0001-fix-compile-procan.c-failed.patch \
+           file://0001-fix-compile-failed-with-musl.patch \
 "
 
-SRC_URI[sha256sum] = "01eb017361d95bb3a6941e840b59e4463a3fabf92df4154ed02b16a2ed6a0095"
+SRC_URI[sha256sum] = "91f222ee65559036600c2505b999acebed48b899f0e2e53ae1c9c31d6986b6a4"
 
 inherit autotools