From 7d95dbbd0a320e9f515db1775f2fc94de7c4cbfc Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 10 May 2018 08:48:24 +0930 Subject: [PATCH] wireaddr: remove FQDN_ADDRLEN in favor of LARGEST_ADDRLEN. Signed-off-by: Rusty Russell --- common/wireaddr.c | 4 ++-- common/wireaddr.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/wireaddr.c b/common/wireaddr.c index 4e799a80a..85f286d91 100644 --- a/common/wireaddr.c +++ b/common/wireaddr.c @@ -108,7 +108,7 @@ bool fromwire_wireaddr_internal(const u8 **cursor, size_t *max, char *fmt_wireaddr(const tal_t *ctx, const struct wireaddr *a) { - char addrstr[FQDN_ADDRLEN]; + char addrstr[LARGEST_ADDRLEN]; char *ret, *hex; switch (a->type) { @@ -212,7 +212,7 @@ REGISTER_TYPE_TO_STRING(wireaddr_internal, fmt_wireaddr_internal); char *fmt_wireaddr_without_port(const tal_t * ctx, const struct wireaddr *a) { - char addrstr[FQDN_ADDRLEN]; + char addrstr[LARGEST_ADDRLEN]; char *ret, *hex; switch (a->type) { diff --git a/common/wireaddr.h b/common/wireaddr.h index 2248f533c..2c71b0874 100644 --- a/common/wireaddr.h +++ b/common/wireaddr.h @@ -33,7 +33,7 @@ struct sockaddr_un; #define TOR_V2_ADDRLEN 12 #define TOR_V3_ADDRLEN 37 -#define FQDN_ADDRLEN 255 +#define LARGEST_ADDRLEN 37 enum wire_addr_type { ADDR_TYPE_PADDING = 0, @@ -47,7 +47,7 @@ enum wire_addr_type { struct wireaddr { enum wire_addr_type type; u8 addrlen; - u8 addr[TOR_V3_ADDRLEN]; //or FQDN_ADDRLEN ? + u8 addr[LARGEST_ADDRLEN]; u16 port; };