httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r1781030 - /httpd/httpd/trunk/modules/metadata/mod_remoteip.c
Date Tue, 31 Jan 2017 08:23:38 GMT
Author: jorton
Date: Tue Jan 31 08:23:38 2017
New Revision: 1781030

URL: http://svn.apache.org/viewvc?rev=1781030&view=rev
Log:
* modules/metadata/mod_remoteip.c: Fix GCC strict-aliasing warning
  by moving deference of header array via a different pointer type 
  ("type-punning") out of line.

Modified:
    httpd/httpd/trunk/modules/metadata/mod_remoteip.c

Modified: httpd/httpd/trunk/modules/metadata/mod_remoteip.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/metadata/mod_remoteip.c?rev=1781030&r1=1781029&r2=1781030&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/metadata/mod_remoteip.c (original)
+++ httpd/httpd/trunk/modules/metadata/mod_remoteip.c Tue Jan 31 08:23:38 2017
@@ -989,6 +989,12 @@ static remoteip_parse_status_t remoteip_
     return HDR_DONE;
 }
 
+/** Return length for a v2 protocol header. */
+static apr_size_t remoteip_get_v2_len(proxy_header *hdr)
+{
+    return ntohs(hdr->v2.len);
+}
+
 /** Determine if this is a v1 or v2 PROXY header.
  */
 static int remoteip_determine_version(conn_rec *c, const char *ptr)
@@ -1112,7 +1118,8 @@ static apr_status_t remoteip_input_filte
             else if (ctx->version == 2) {
                 if (ctx->rcvd >= MIN_V2_HDR_LEN) {
                     ctx->need = MIN_V2_HDR_LEN +
-                                ntohs(((proxy_header *) ctx->header)->v2.len);
+                        remoteip_get_v2_len((proxy_header *) ctx->header);
+
                 }
                 if (ctx->rcvd >= ctx->need) {
                     psts = remoteip_process_v2_header(f->c, conn_conf,



Mime
View raw message