]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: protocol: move the l3_addrlen to plug a hole in proto_fam
authorWilly Tarreau <w@1wt.eu>
Sat, 22 Apr 2023 09:18:54 +0000 (11:18 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 23 Apr 2023 07:46:15 +0000 (09:46 +0200)
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.

include/haproxy/protocol-t.h

index e49a239ceb0f04a36e7196380769bbad7e87b27a..9a3420c1312906427267afdc3a20700e10ca42c8 100644 (file)
@@ -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 */