wireaddr: fix parsing of empty address with no port.

Port should become the default in not specified.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2018-05-10 12:08:24 +09:30
parent cca791d1cb
commit 1ab9a5def6

View File

@ -394,6 +394,7 @@ bool parse_wireaddr_internal(const char *arg, struct wireaddr_internal *addr,
/* An empty string means IPv4 and IPv6 (which under Linux by default
* means just IPv6, and IPv4 gets autobound). */
wildport = port;
if (wildcard_ok
&& separate_address_and_port(tmpctx, arg, &ip, &wildport)
&& streq(ip, "")) {