From 32228c665506b1d84e0758c81fcb9ff3d8f8bef4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Holger=20Wei=C3=9F?= <holger@zedat.fu-berlin.de>
Date: Wed, 13 Jul 2011 15:49:04 +0200
Subject: Let epmd ignore empty ERL_EPMD_ADDRESS

If the environment variable ERL_EPMD_ADDRESS is set to the empty string,
empd now behaves like it does by default when ERL_EPMD_ADDRESS is unset.
That is, in this case, epmd now listens on all available interfaces
instead of using only the loopback interface, which happened because
epmd added the loopback address to the (in this case empty) list of
addresses specified via ERL_EPMD_ADDRESS.

Also, epmd now ignores ERL_EPMD_ADDRESS if it contains only separator
characters (comma and space).

The same applies to epmd's -address option.
---
 erts/epmd/src/epmd_srv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'erts/epmd')

diff --git a/erts/epmd/src/epmd_srv.c b/erts/epmd/src/epmd_srv.c
index 5debae26b6..da575affa1 100644
--- a/erts/epmd/src/epmd_srv.c
+++ b/erts/epmd/src/epmd_srv.c
@@ -102,7 +102,8 @@ void run(EpmdVars *g)
 
   dbg_printf(g,2,"try to initiate listening port %d", g->port);
 
-  if (g->addresses != NULL)
+  if (g->addresses != NULL && /* String contains non-separator characters if: */
+      g->addresses[strspn(g->addresses," ,")] != '\000')
     {
       char *tmp;
       char *token;
-- 
cgit v1.2.3