Skip to content

Commit

Permalink
AP_HAL: Allow APMSockets to autodetect Broadcast IPs
Browse files Browse the repository at this point in the history
  • Loading branch information
magicrub committed Nov 25, 2023
1 parent ee59247 commit 3bf5403
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libraries/AP_HAL/utility/Socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ bool SocketAPM::connect(const char *address, uint16_t port)
if (ret == -1) {
goto fail_mc;
}
} else if (datagram && sockaddr.sin_addr.s_addr == INADDR_BROADCAST) {
set_broadcast();
}

ret = CALL_PREFIX(connect)(fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr));
Expand Down

0 comments on commit 3bf5403

Please sign in to comment.