wireaddr: remove FQDN_ADDRLEN in favor of LARGEST_ADDRLEN.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2018-05-10 08:48:24 +09:30
parent c1e0a4d572
commit 7d95dbbd0a
2 changed files with 4 additions and 4 deletions

View File

@ -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) {

View File

@ -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;
};