From b19ff59668fe7ccbe16112c99cf0197134d89427 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 12 Mar 2025 09:27:42 -0700 Subject: libwebsockets: Fix build with clang-20 Backport a needed patch from main branch upstream Signed-off-by: Khem Raj --- .../0001-sll_protocol-may-be-be16.patch | 29 ++++++++++++++++++++++ .../libwebsockets/libwebsockets_4.3.5.bb | 4 ++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 meta-oe/recipes-connectivity/libwebsockets/libwebsockets/0001-sll_protocol-may-be-be16.patch (limited to 'meta-oe') diff --git a/meta-oe/recipes-connectivity/libwebsockets/libwebsockets/0001-sll_protocol-may-be-be16.patch b/meta-oe/recipes-connectivity/libwebsockets/libwebsockets/0001-sll_protocol-may-be-be16.patch new file mode 100644 index 0000000000..c27644ef7d --- /dev/null +++ b/meta-oe/recipes-connectivity/libwebsockets/libwebsockets/0001-sll_protocol-may-be-be16.patch @@ -0,0 +1,29 @@ +From 99e3ad14c60599e5d73e4d5597c95c3b91780547 Mon Sep 17 00:00:00 2001 +From: Andy Green +Date: Wed, 22 Jan 2025 10:08:55 +0000 +Subject: [PATCH] sll_protocol may be be16 + +Google's fuzzer platform blows a warning + +/src/libwebsockets/lib/plat/unix/unix-sockets.c:497:21: warning: implicit conversion loses integer precision: 'uint32_t' (aka 'unsigned int') to '__be16' (aka 'unsigned short') [-Wimplicit-int-conversion] + 497 | sll.sll_protocol = (uint32_t)(htons((uint16_t)0x800)); + +Upstream-Status: Backport [https://github.com/warmcat/libwebsockets/commit/2ffb8c6d5eaab509a133f3a6d922e170ae95dd59] +Signed-off-by: Khem Raj +--- + lib/plat/unix/unix-sockets.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/plat/unix/unix-sockets.c b/lib/plat/unix/unix-sockets.c +index 1a40c9cf..61292ff8 100644 +--- a/lib/plat/unix/unix-sockets.c ++++ b/lib/plat/unix/unix-sockets.c +@@ -453,7 +453,7 @@ lws_plat_rawudp_broadcast(uint8_t *p, const uint8_t *canned, size_t canned_len, + + memset(&sll, 0, sizeof(sll)); + sll.sll_family = AF_PACKET; +- sll.sll_protocol = (uint32_t)(htons((uint16_t)0x800)); ++ sll.sll_protocol = (uint16_t)(htons((uint16_t)0x800)); + sll.sll_halen = 6; + sll.sll_ifindex = (int)if_nametoindex(iface); + memset(sll.sll_addr, 0xff, 6); diff --git a/meta-oe/recipes-connectivity/libwebsockets/libwebsockets_4.3.5.bb b/meta-oe/recipes-connectivity/libwebsockets/libwebsockets_4.3.5.bb index b7120a9975..4d6ec3b7ea 100644 --- a/meta-oe/recipes-connectivity/libwebsockets/libwebsockets_4.3.5.bb +++ b/meta-oe/recipes-connectivity/libwebsockets/libwebsockets_4.3.5.bb @@ -8,7 +8,9 @@ DEPENDS:append:class-native = " libcap-native" S = "${WORKDIR}/git" SRCREV = "ab9df9cfc39de7a49967f18387b6b76310947442" -SRC_URI = "git://github.com/warmcat/libwebsockets.git;protocol=https;branch=v4.3-stable" +SRC_URI = "git://github.com/warmcat/libwebsockets.git;protocol=https;branch=v4.3-stable \ + file://0001-sll_protocol-may-be-be16.patch \ + " UPSTREAM_CHECK_URI = "https://github.com/warmcat/${BPN}/releases" UPSTREAM_CHECK_GITTAGREGEX = "v(?P\d+(\.\d+)+)" -- cgit v1.2.3-54-g00ecf