From: Willy Tarreau Date: Sat, 22 Apr 2023 09:18:54 +0000 (+0200) Subject: CLEANUP: protocol: move the l3_addrlen to plug a hole in proto_fam X-Git-Tag: v2.8-dev8~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=798d6b41245ce34abc6d7a2ba14cc4f3dfecdaf1;p=thirdparty%2Fhaproxy.git CLEANUP: protocol: move the l3_addrlen to plug a hole in proto_fam There's a two-byte hole in proto_fam after sock_family, let's move the l3_addrlen there as a ushort. Note that contrary to what the comment says, it's still not used by hash algorithms though it could. --- diff --git a/include/haproxy/protocol-t.h b/include/haproxy/protocol-t.h index e49a239ceb..9a3420c131 100644 --- a/include/haproxy/protocol-t.h +++ b/include/haproxy/protocol-t.h @@ -71,8 +71,9 @@ struct proto_fam { char name[PROTO_NAME_LEN]; /* family name, zero-terminated */ int sock_domain; /* socket domain, as passed to socket() */ sa_family_t sock_family; /* socket family, for sockaddr */ + ushort l3_addrlen; /* layer3 address length, used by hashes */ socklen_t sock_addrlen; /* socket address length, used by bind() */ - int l3_addrlen; /* layer3 address length, used by hashes */ + /* 4-bytes hole here */ int (*addrcmp)(const struct sockaddr_storage *, const struct sockaddr_storage *); /* compare addresses (like memcmp) */ int (*bind)(struct receiver *rx, char **errmsg); /* bind a receiver */ int (*get_src)(int fd, struct sockaddr *, socklen_t, int dir); /* syscall used to retrieve connection's src addr */