From b298e2acb07234da685c547f7c98a06d5200b216 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Wed, 17 May 2017 21:55:32 -0400 Subject: [PATCH] [mod_extforward] quiet clang compiler warning It does seem possible for PROXY protocol subelements to be misaligned and a message has been sent to HAProxy author of the PROXY protocol. On most modern processors and operating systems, misaligned access has a cost, but not the outrageous cost that it historical had on processors and older operating systems such as on SPARC processors running Solaris prior to Solaris 11. --- src/mod_extforward.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mod_extforward.c b/src/mod_extforward.c index 2020a4e8..b7539288 100644 --- a/src/mod_extforward.c +++ b/src/mod_extforward.c @@ -1520,7 +1520,8 @@ static int mod_extforward_hap_PROXY_v2 (connection * const con, static const uint32_t zero = 0; handler_ctx *hctx = con->plugin_ctx[mod_extforward_plugin_data_singleton->id]; - struct pp2_tlv_ssl *tlv_ssl = (struct pp2_tlv_ssl *)((char *)tlv+3); + struct pp2_tlv_ssl *tlv_ssl = + (struct pp2_tlv_ssl *)(void *)((char *)tlv+3); struct pp2_tlv *subtlv = tlv; if (tlv_ssl->client & PP2_CLIENT_SSL) { buffer_copy_string_len(con->proto, CONST_STR_LEN("https"));