aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2016-03-02 15:52:00 +0100
committerIngela Anderton Andin <[email protected]>2016-03-02 15:52:00 +0100
commit9020ce9ab8347a781d4f761a1389bec4fd2bb468 (patch)
tree9b27a6c4766587ffc926d32fc9991735a8afc19b
parent52da57c29bc18ff103cb5382625342b4a8f0c7cf (diff)
parentb1e4836bcfbfdec0504219ed490c5f53860d8106 (diff)
downloadotp-9020ce9ab8347a781d4f761a1389bec4fd2bb468.tar.gz
otp-9020ce9ab8347a781d4f761a1389bec4fd2bb468.tar.bz2
otp-9020ce9ab8347a781d4f761a1389bec4fd2bb468.zip
Merge branch 'ia/msantos/unsupported-protocols' into maint
* ia/msantos/unsupported-protocols: Skips any sockets with unsupported protocols.
-rw-r--r--erts/epmd/src/epmd_srv.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/erts/epmd/src/epmd_srv.c b/erts/epmd/src/epmd_srv.c
index 55ec0f7b6c..e1bac99ef9 100644
--- a/erts/epmd/src/epmd_srv.c
+++ b/erts/epmd/src/epmd_srv.c
@@ -380,7 +380,7 @@ void run(EpmdVars *g)
epmd_cleanup_exit(g,1);
}
}
- g->listenfd[i] = listensock[i];
+ g->listenfd[bound++] = listensock[i];
#if HAVE_DECL_IPV6_V6ONLY
opt = 1;
@@ -439,8 +439,6 @@ void run(EpmdVars *g)
}
}
- bound++;
-
if(listen(listensock[i], SOMAXCONN) < 0) {
dbg_perror(g,"failed to listen on socket");
epmd_cleanup_exit(g,1);
@@ -451,6 +449,7 @@ void run(EpmdVars *g)
dbg_perror(g,"unable to bind any address");
epmd_cleanup_exit(g,1);
}
+ num_sockets = bound;
#ifdef HAVE_SYSTEMD_DAEMON
}
sd_notifyf(0, "READY=1\n"
@@ -495,8 +494,8 @@ void run(EpmdVars *g)
}
for (i = 0; i < num_sockets; i++)
- if (FD_ISSET(listensock[i],&read_mask)) {
- if (do_accept(g, listensock[i]) && g->active_conn < g->max_conn) {
+ if (FD_ISSET(g->listenfd[i],&read_mask)) {
+ if (do_accept(g, g->listenfd[i]) && g->active_conn < g->max_conn) {
/*
* The accept() succeeded, and we have at least one file
* descriptor still free, which means that another accept()