tif no interface is specified with -i listen on all, unless -4 or -6 is specified - geomyidae - A small C-based gopherd. (gopher://bitreich.org/1/scm/geomyidae)
git clone git://r-36.net/geomyidae
Log
Files
Refs
README
LICENSE
---
commit 3db43cc72cf7a9ca314ecafba616e8d7910e30f5
parent aa6b70539a2b175efadad1d5f6a771d77a92f8ef
Author: Hiltjo Posthuma 
Date:   Sun, 11 Nov 2018 15:07:23 +0100

if no interface is specified with -i listen on all, unless -4 or -6 is specified

Signed-off-by: Christoph Lohmann <20h@r-36.net>

Diffstat:
  main.c                              |      12 ++++++++----

1 file changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/main.c b/main.c
t@@ -543,10 +543,14 @@ main(int argc, char *argv[])
         }
 
         if (bindips == NULL) {
-                bindips = xrealloc(bindips, sizeof(*bindips) * (++nbindips));
-                bindips[nbindips-1] = "0.0.0.0";
-                bindips = xrealloc(bindips, sizeof(*bindips) * (++nbindips));
-                bindips[nbindips-1] = "::";
+                if (inetf == AF_INET || inetf == AF_UNSPEC) {
+                        bindips = xrealloc(bindips, sizeof(*bindips) * (++nbindips));
+                        bindips[nbindips-1] = "0.0.0.0";
+                }
+                if (inetf == AF_INET6 || inetf == AF_UNSPEC) {
+                        bindips = xrealloc(bindips, sizeof(*bindips) * (++nbindips));
+                        bindips[nbindips-1] = "::";
+                }
         }
 
         for (i = 0; i < nbindips; i++) {