mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-29 15:43:56 +00:00
try to reuse interface binding socket addresses instead of failing.
This commit is contained in:
parent
2434d51bee
commit
fa8825a3ec
@ -187,6 +187,13 @@ int overlay_interface_init_socket(int interface,struct sockaddr_in src_addr,stru
|
||||
} else
|
||||
WHYF("interface #%d fd=%d",interface,I(fd));
|
||||
|
||||
int reuseP=1;
|
||||
if(setsockopt( I(fd), SOL_SOCKET, SO_REUSEADDR, &reuseP, sizeof(reuseP)) < 0)
|
||||
{
|
||||
WHY("Could not mark socket to reuse addresses. Not necessarily a problem (yet)");
|
||||
WHY_perror("setsockopt");
|
||||
}
|
||||
|
||||
int broadcastP=1;
|
||||
if(setsockopt(I(fd), SOL_SOCKET, SO_BROADCAST, &broadcastP, sizeof(broadcastP)) < 0) {
|
||||
WHY("Could not enable broadcast reception for socket. This is really bad.");
|
||||
|
Loading…
x
Reference in New Issue
Block a user