Code Review
/
src
/
app-framework-binder.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
f3048dc
)
afb-socket: Handle listening on all interfaces
19/17519/1
author
Jose Bollo
<jose.bollo@iot.bzh>
Tue, 30 Oct 2018 09:55:49 +0000
(10:55 +0100)
committer
José Bollo
<jose.bollo@iot.bzh>
Tue, 30 Oct 2018 15:39:55 +0000
(16:39 +0100)
Change-Id: I909493166f98f152e5aeb02a72f40bc3c58b42b2
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
src/afb-socket.c
patch
|
blob
|
history
diff --git
a/src/afb-socket.c
b/src/afb-socket.c
index
f4ee7e1
..
63de2cf
100644
(file)
--- a/
src/afb-socket.c
+++ b/
src/afb-socket.c
@@
-178,6
+178,11
@@
static int open_tcp(const char *spec, int server)
memset(&hint, 0, sizeof hint);
hint.ai_family = AF_INET;
hint.ai_socktype = SOCK_STREAM;
+ if (server) {
+ hint.ai_flags = AI_PASSIVE;
+ if (host[0] == 0 || (host[0] == '*' && host[1] == 0))
+ host = NULL;
+ }
rc = getaddrinfo(host, service, &hint, &rai);
if (rc != 0) {
errno = EINVAL;