From: Tim Duesterhus Date: Thu, 5 Mar 2020 22:11:02 +0000 (+0100) Subject: CLEANUP: proxy_protocol: Use `size_t` when parsing TLVs X-Git-Tag: v2.2-dev4~47 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ba837ec3674a1a783a56f8ecc040f4fc475bd2f5;p=thirdparty%2Fhaproxy.git CLEANUP: proxy_protocol: Use `size_t` when parsing TLVs Change `int` to `size_t` for consistency. --- diff --git a/src/connection.c b/src/connection.c index 1ea8e9f2a9..4e3a92f0c9 100644 --- a/src/connection.c +++ b/src/connection.c @@ -457,7 +457,7 @@ int conn_sock_drain(struct connection *conn) /* * Get data length from tlv */ -static int get_tlv_length(const struct tlv *src) +static inline size_t get_tlv_length(const struct tlv *src) { return (src->length_hi << 8) | src->length_lo; } @@ -491,7 +491,7 @@ int conn_recv_proxy(struct connection *conn, int flag) struct proxy_hdr_v2 *hdr_v2; const char v2sig[] = PP2_SIGNATURE; size_t total_v2_len; - int tlv_offset = 0; + size_t tlv_offset = 0; int ret; if (!conn_ctrl_ready(conn)) @@ -706,7 +706,7 @@ int conn_recv_proxy(struct connection *conn, int flag) /* TLV parsing */ while (tlv_offset < total_v2_len) { struct tlv *tlv_packet; - int tlv_len; + size_t tlv_len; /* Verify that we have at least TLV_HEADER_SIZE bytes left */ if (tlv_offset + TLV_HEADER_SIZE > total_v2_len)