summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-05-31 17:47:54 +0200
committerHarald Welte <laforge@gnumonks.org>2011-05-31 17:47:54 +0200
commitf9e0746add961552366416e1f55878baf20be44b (patch)
tree4a05b43bf6149fa6a797373f4411d12e4f87f567 /src
parent271c43b0ae533c0371b2380f91e79dc97bdd0bcc (diff)
socket: getaddrinfo(): set AI_PASSIVE if we want to bind
This will tell getaddrinfo() that we want a INADDR_ANY style socket
Diffstat (limited to 'src')
-rw-r--r--src/socket.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/socket.c b/src/socket.c
index 014bbaa2..0be98b93 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -31,6 +31,9 @@ int osmo_sock_init(uint16_t family, uint16_t type, uint8_t proto,
hints.ai_flags = 0;
hints.ai_protocol = proto;
+ if (connect0_bind1)
+ hints.ai_flags |= AI_PASSIVE;
+
rc = getaddrinfo(host, portbuf, &hints, &result);
if (rc != 0) {
perror("getaddrinfo returned NULL");