mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-17 19:03:42 +01:00
lightningd: don't allow --announce-addr with a wildcard address.
It doesn't make sense. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
1ab9a5def6
commit
011d75c618
@ -147,7 +147,8 @@ static char *opt_set_s32(const char *arg, s32 *u)
|
|||||||
|
|
||||||
static char *opt_add_addr_withtype(const char *arg,
|
static char *opt_add_addr_withtype(const char *arg,
|
||||||
struct lightningd *ld,
|
struct lightningd *ld,
|
||||||
enum addr_listen_announce ala)
|
enum addr_listen_announce ala,
|
||||||
|
bool wildcard_ok)
|
||||||
{
|
{
|
||||||
size_t n = tal_count(ld->proposed_wireaddr);
|
size_t n = tal_count(ld->proposed_wireaddr);
|
||||||
char const *err_msg;
|
char const *err_msg;
|
||||||
@ -159,7 +160,8 @@ static char *opt_add_addr_withtype(const char *arg,
|
|||||||
ld->proposed_listen_announce[n] = ala;
|
ld->proposed_listen_announce[n] = ala;
|
||||||
|
|
||||||
if (!parse_wireaddr_internal(arg, &ld->proposed_wireaddr[n], ld->portnum,
|
if (!parse_wireaddr_internal(arg, &ld->proposed_wireaddr[n], ld->portnum,
|
||||||
true, !ld->use_proxy_always, &err_msg)) {
|
wildcard_ok, !ld->use_proxy_always,
|
||||||
|
&err_msg)) {
|
||||||
return tal_fmt(NULL, "Unable to parse address '%s': %s", arg, err_msg);
|
return tal_fmt(NULL, "Unable to parse address '%s': %s", arg, err_msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,17 +171,17 @@ static char *opt_add_addr_withtype(const char *arg,
|
|||||||
|
|
||||||
static char *opt_add_addr(const char *arg, struct lightningd *ld)
|
static char *opt_add_addr(const char *arg, struct lightningd *ld)
|
||||||
{
|
{
|
||||||
return opt_add_addr_withtype(arg, ld, ADDR_LISTEN_AND_ANNOUNCE);
|
return opt_add_addr_withtype(arg, ld, ADDR_LISTEN_AND_ANNOUNCE, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *opt_add_bind_addr(const char *arg, struct lightningd *ld)
|
static char *opt_add_bind_addr(const char *arg, struct lightningd *ld)
|
||||||
{
|
{
|
||||||
return opt_add_addr_withtype(arg, ld, ADDR_LISTEN);
|
return opt_add_addr_withtype(arg, ld, ADDR_LISTEN, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *opt_add_announce_addr(const char *arg, struct lightningd *ld)
|
static char *opt_add_announce_addr(const char *arg, struct lightningd *ld)
|
||||||
{
|
{
|
||||||
return opt_add_addr_withtype(arg, ld, ADDR_ANNOUNCE);
|
return opt_add_addr_withtype(arg, ld, ADDR_ANNOUNCE, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *opt_add_ipaddr(const char *arg, struct lightningd *ld)
|
static char *opt_add_ipaddr(const char *arg, struct lightningd *ld)
|
||||||
|
Loading…
Reference in New Issue
Block a user