mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-18 02:39:44 +00:00
overlay interface file descriptors now marked close-on-exec so that
if we get a sigabort or segmentation violation and restart ourselves, we don't wind up with stuck/lost sockets.
This commit is contained in:
parent
18385fff82
commit
6397fa70d9
@ -189,6 +189,13 @@ int overlay_interface_init_socket(int interface,struct sockaddr_in src_addr,stru
|
||||
return WHY("Could not create UDP socket for interface");
|
||||
}
|
||||
|
||||
/* Automatically close socket on calls to exec().
|
||||
This makes life easier when we restart with an exec after receiving
|
||||
a bad signal. */
|
||||
fcntl(I(fd), F_SETFL,
|
||||
fcntl(I(fd), F_GETFL, NULL)|O_CLOEXEC);
|
||||
|
||||
|
||||
src_addr.sin_family = AF_INET;
|
||||
src_addr.sin_port = htons( I(port) );
|
||||
/* XXX Is this right? Are we really setting the local side address?
|
||||
|
Loading…
Reference in New Issue
Block a user