  
  	  if (inet_pton(AF_INET6,token,&addr6) == 1)
  	    {
-@@ -296,15 +286,6 @@ void run(EpmdVars *g)
+@@ -301,15 +292,6 @@ void run(EpmdVars *g)
  	      epmd_cleanup_exit(g,1);
  	    }
  

 	  num_sockets++;
 
 	  if (num_sockets >= MAX_LISTEN_SOCKETS)
@@ -366,16 +347,10 @@ void run(EpmdVars *g)
 
       if ((listensock[i] = socket(sa->sa_family,SOCK_STREAM,0)) < 0)
 	{
-	  switch (errno) {
-	      case EAFNOSUPPORT:
-	      case EPROTONOSUPPORT:
-	          continue;
-	      default:
-	          dbg_perror(g,"error opening stream socket");
-	          epmd_cleanup_exit(g,1);
-	  }
+	  dbg_perror(g,"error opening stream socket");
+	  epmd_cleanup_exit(g,1);
 	}
-      g->listenfd[bound++] = listensock[i];
+      g->listenfd[i] = listensock[i];
 
 #if HAVE_DECL_IPV6_V6ONLY
       opt = 1;
@@ -440,11 +415,6 @@ void run(EpmdVars *g)
       }
       select_fd_set(g, listensock[i]);
     }
-  if (bound == 0) {
-      dbg_perror(g,"unable to bind any address");
-      epmd_cleanup_exit(g,1);
-  }
-  num_sockets = bound;
 #ifdef HAVE_SYSTEMD_DAEMON
     }
     if (g->is_systemd) {
-- 
2.11.0


From fae952def3698b588b96231862123ee3547c702e Mon Sep 17 00:00:00 2001
From: Steven Danna <steve@chef.io>
Date: Tue, 14 Nov 2017 21:08:05 +0000
Subject: [PATCH] epmd: require explicitly adding address

Based on the following PR:

   https://github.com/erlang/otp/pull/1075/commits/0800214dc6aec5327f4e984047dd05a8829ae5e4
---
 erts/epmd/src/epmd_srv.c | 31 ++++++++++++-------------------
 1 file changed, 12 insertions(+), 19 deletions(-)

diff --git a/erts/epmd/src/epmd_srv.c b/erts/epmd/src/epmd_srv.c
index e1bac99ef9..f42a97330e 100644
--- a/erts/epmd/src/epmd_srv.c
+++ b/erts/epmd/src/epmd_srv.c
@@ -257,14 +257,6 @@ void run(EpmdVars *g)
       char *tmp = NULL;
       char *token = NULL;
 
