if no interface is specified with -i listen on all, unless -4 or -6 is specified - geomyidae - A small C-based gopherd. HTML git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/geomyidae/ DIR Log DIR Files DIR Refs DIR Tags DIR README DIR LICENSE --- DIR commit 3db43cc72cf7a9ca314ecafba616e8d7910e30f5 DIR parent aa6b70539a2b175efadad1d5f6a771d77a92f8ef HTML Author: Hiltjo Posthuma <hiltjo@codemadness.org> 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: M main.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) --- DIR diff --git a/main.c b/main.c @@ -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++) {