Skip to content

Commit

Permalink
Revert adding sin_len since it breaks Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSchinazi committed Jan 12, 2025
1 parent 02d66a4 commit 98f45e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/jazzlights/network/unix_udp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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_,
Expand Down

0 comments on commit 98f45e0

Please sign in to comment.