Browse Source

wireaddr: remove FQDN_ADDRLEN in favor of LARGEST_ADDRLEN.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 7 years ago
parent
commit
7d95dbbd0a
  1. 4
      common/wireaddr.c
  2. 4
      common/wireaddr.h

4
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 *fmt_wireaddr(const tal_t *ctx, const struct wireaddr *a)
{ {
char addrstr[FQDN_ADDRLEN]; char addrstr[LARGEST_ADDRLEN];
char *ret, *hex; char *ret, *hex;
switch (a->type) { 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 *fmt_wireaddr_without_port(const tal_t * ctx, const struct wireaddr *a)
{ {
char addrstr[FQDN_ADDRLEN]; char addrstr[LARGEST_ADDRLEN];
char *ret, *hex; char *ret, *hex;
switch (a->type) { switch (a->type) {

4
common/wireaddr.h

@ -33,7 +33,7 @@ struct sockaddr_un;
#define TOR_V2_ADDRLEN 12 #define TOR_V2_ADDRLEN 12
#define TOR_V3_ADDRLEN 37 #define TOR_V3_ADDRLEN 37
#define FQDN_ADDRLEN 255 #define LARGEST_ADDRLEN 37
enum wire_addr_type { enum wire_addr_type {
ADDR_TYPE_PADDING = 0, ADDR_TYPE_PADDING = 0,
@ -47,7 +47,7 @@ enum wire_addr_type {
struct wireaddr { struct wireaddr {
enum wire_addr_type type; enum wire_addr_type type;
u8 addrlen; u8 addrlen;
u8 addr[TOR_V3_ADDRLEN]; //or FQDN_ADDRLEN ? u8 addr[LARGEST_ADDRLEN];
u16 port; u16 port;
}; };

Loading…
Cancel
Save