From 99e3ad14c60599e5d73e4d5597c95c3b91780547 Mon Sep 17 00:00:00 2001
From: Andy Green <andy@warmcat.com>
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 <raj.khem@gmail.com>
---
 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);
