mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-02-11 05:12:01 +00:00
Fix 719d1fe72cc25ecbd73f00189595d5d1936141a4 (SOCK_DGRAM vs SOCK_STREAM)
This commit is contained in:
parent
4f94f8701a
commit
79d5563344
@ -74,7 +74,8 @@ monitor_setup_sockets(void) {
|
||||
/* ignore SIGPIPE so that we don't explode */
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
|
||||
if ((monitor_named_socket = socket_bind(confValueGet("monitor.socket", DEFAULT_MONITOR_SOCKET_NAME), 0)) == -1) {
|
||||
if ((monitor_named_socket = socket_bind(confValueGet("monitor.socket", DEFAULT_MONITOR_SOCKET_NAME),
|
||||
SOCK_STREAM, 0)) == -1) {
|
||||
WHY_perror("bind");
|
||||
goto error;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ overlay_mdp_setup_sockets(void) {
|
||||
if (mdp_socket != -1)
|
||||
return 0;
|
||||
|
||||
if ((mdp_socket = socket_bind(confValueGet("mdp.socket", DEFAULT_MDP_SOCKET_NAME), 1)) == -1) {
|
||||
if ((mdp_socket = socket_bind(confValueGet("mdp.socket", DEFAULT_MDP_SOCKET_NAME), SOCK_DGRAM, 1)) == -1) {
|
||||
WHY_perror("socket_bind");
|
||||
goto error;
|
||||
}
|
||||
|
4
socket.c
4
socket.c
@ -39,12 +39,12 @@
|
||||
* more than one servald on a given system.
|
||||
*/
|
||||
int
|
||||
socket_bind(const char *name, int reuse) {
|
||||
socket_bind(const char *name, int type, int reuse) {
|
||||
int s, oerrno, reuseP;
|
||||
struct sockaddr_un sockname;
|
||||
socklen_t len;
|
||||
|
||||
if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
|
||||
if ((s = socket(AF_UNIX, type, 0)) == -1)
|
||||
return -1;
|
||||
|
||||
if (reuse) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user