| 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(-)
--- |
| 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++) { |