pex-msg: enable broadcast for global PEX socket
authorFelix Fietkau <nbd@nbd.name>
Mon, 16 Dec 2024 11:16:26 +0000 (12:16 +0100)
committerFelix Fietkau <nbd@nbd.name>
Mon, 16 Dec 2024 11:16:27 +0000 (12:16 +0100)
Fixes network data sync with broadcast addr

Signed-off-by: Felix Fietkau <nbd@nbd.name>
pex-msg.c

index d7581b96e0807957a88a070d186da9ca0d977a9b..1d85b268ac9a5bd179ea5942f3841f4dd44cfd04 100644 (file)
--- a/pex-msg.c
+++ b/pex-msg.c
@@ -626,6 +626,7 @@ int pex_open(void *addr, size_t addr_len, pex_recv_cb_t cb, bool server)
                        goto close_socket;
                }
 
+               setsockopt(fd, SOL_SOCKET, SO_BROADCAST, &yes, sizeof(yes));
                setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes));
                setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &yes, sizeof(yes));
                setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &no, sizeof(no));