mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-02-14 06:32:30 +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 */
|
/* ignore SIGPIPE so that we don't explode */
|
||||||
signal(SIGPIPE, SIG_IGN);
|
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");
|
WHY_perror("bind");
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ overlay_mdp_setup_sockets(void) {
|
|||||||
if (mdp_socket != -1)
|
if (mdp_socket != -1)
|
||||||
return 0;
|
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");
|
WHY_perror("socket_bind");
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
4
socket.c
4
socket.c
@ -39,12 +39,12 @@
|
|||||||
* more than one servald on a given system.
|
* more than one servald on a given system.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
socket_bind(const char *name, int reuse) {
|
socket_bind(const char *name, int type, int reuse) {
|
||||||
int s, oerrno, reuseP;
|
int s, oerrno, reuseP;
|
||||||
struct sockaddr_un sockname;
|
struct sockaddr_un sockname;
|
||||||
socklen_t len;
|
socklen_t len;
|
||||||
|
|
||||||
if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
|
if ((s = socket(AF_UNIX, type, 0)) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (reuse) {
|
if (reuse) {
|
||||||
|
2
socket.h
2
socket.h
@ -1,4 +1,4 @@
|
|||||||
int socket_bind(const char *name, int reuse);
|
int socket_bind(const char *name, int type, int reuse);
|
||||||
void socket_setname(struct sockaddr_un *sockname, const char *name, socklen_t *len);
|
void socket_setname(struct sockaddr_un *sockname, const char *name, socklen_t *len);
|
||||||
void socket_done(const char *name);
|
void socket_done(const char *name);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user