diff --git a/common/wireaddr.c b/common/wireaddr.c index a5044eba63c7..f7666090156b 100644 --- a/common/wireaddr.c +++ b/common/wireaddr.c @@ -8,9 +8,7 @@ #include #include #include -#include #include -#include #include /* Returns false if we didn't parse it, and *cursor == NULL if malformed. */ diff --git a/common/wireaddr.h b/common/wireaddr.h index 994774c01268..cfffcfb3c749 100644 --- a/common/wireaddr.h +++ b/common/wireaddr.h @@ -5,6 +5,8 @@ #include #include #include +#include +#include struct in6_addr; struct in_addr; @@ -87,12 +89,12 @@ enum wireaddr_internal_type { struct wireaddr_internal { enum wireaddr_internal_type itype; union { - /* ADDR_INTERNAL_SOCKNAME */ + /* ADDR_INTERNAL_WIREADDR */ struct wireaddr wireaddr; /* ADDR_INTERNAL_ALLPROTO */ u16 port; - /* ADDR_INTERNAL_WIREADDR */ - char sockname[108]; + /* ADDR_INTERNAL_SOCKNAME */ + char sockname[sizeof(((struct sockaddr_un *)0)->sun_path)]; } u; }; bool parse_wireaddr_internal(const char *arg, struct wireaddr_internal *addr, u16 port, bool wildcard_ok, const char **err_msg);