projects
/
osmocom-bb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
271c43b
)
socket: getaddrinfo(): set AI_PASSIVE if we want to bind
author
Harald Welte
<laforge@gnumonks.org>
Tue, 31 May 2011 15:47:54 +0000
(17:47 +0200)
committer
Harald Welte
<laforge@gnumonks.org>
Tue, 31 May 2011 15:47:54 +0000
(17:47 +0200)
This will tell getaddrinfo() that we want a INADDR_ANY style socket
src/socket.c
patch
|
blob
|
history
diff --git
a/src/socket.c
b/src/socket.c
index
014bbaa
..
0be98b9
100644
(file)
--- 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");