Skip to content

Commit

Permalink
fix #46
Browse files Browse the repository at this point in the history
  • Loading branch information
esm-tmori committed Apr 5, 2021
1 parent 93ce024 commit ebc2a9c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/udp/udp_comm.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ Std_ReturnType udp_comm_create_ipaddr(const UdpCommConfigType *config, UdpCommTy
}
comm->srv_sock = err;

#ifdef ENABLE_REUSE_UDP_SOCKET
int yes = 1;
setsockopt(comm->srv_sock, SOL_SOCKET, SO_REUSEADDR, (const char *)&yes, sizeof(yes));
#endif

addr.sin_family = AF_INET;
addr.sin_port = htons(config->server_port);
if (my_ipaddr == NULL) {
Expand Down

0 comments on commit ebc2a9c

Please sign in to comment.