From 98f45e05941fdee244924307e5bfc6df78c0907e Mon Sep 17 00:00:00 2001 From: David Schinazi Date: Sat, 11 Jan 2025 22:08:56 -0800 Subject: [PATCH] Revert adding sin_len since it breaks Linux --- src/jazzlights/network/unix_udp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jazzlights/network/unix_udp.cpp b/src/jazzlights/network/unix_udp.cpp index 4025b55..c7aeff7 100644 --- a/src/jazzlights/network/unix_udp.cpp +++ b/src/jazzlights/network/unix_udp.cpp @@ -58,7 +58,7 @@ int UnixUdpNetwork::setupSocketForInterface(const char* ifName, struct in_addr l } sockaddr_in sin = { - .sin_len = sizeof(struct sockaddr_in), + // Do not set sin_len since it is no longer available on Linux and it is not needed on macOS. .sin_family = AF_INET, .sin_port = htons(DefaultUdpPort()), // .sin_addr = localAddr, @@ -224,7 +224,7 @@ int UnixUdpNetwork::recv(void* buf, size_t bufsize, std::string* /*details*/) { void UnixUdpNetwork::send(void* buf, size_t bufsize) { setupSockets(); sockaddr_in sin = { - .sin_len = sizeof(struct sockaddr_in), + // Do not set sin_len since it is no longer available on Linux and it is not needed on macOS. .sin_family = AF_INET, .sin_port = htons(DefaultUdpPort()), .sin_addr = mcastAddr_,