]> granicus.if.org Git - apache/commitdiff
mod_remoteip: Set useragent port to zero PR59931
authorEric Covener <covener@apache.org>
Thu, 29 Dec 2016 18:27:12 +0000 (18:27 +0000)
committerEric Covener <covener@apache.org>
Thu, 29 Dec 2016 18:27:12 +0000 (18:27 +0000)
When overriding the useragent address from X-Forwarded-For,
zero out what had been initialized as the connection-level port.

Submitted By: Hank Ibell <hwibell gmail.com>

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1776458 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/metadata/mod_remoteip.c

diff --git a/CHANGES b/CHANGES
index 52f02efe33ac71cf97dd9cdc1a95c4255c04f547..1de27cba17afad9f34aee63e280a981924e06525 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_remoteip: When overriding the useragent address from X-Forwarded-For,
+     zero out what had been initialized as the connection-level port.  PR59931.
+     [Hank Ibell <hwibell gmail.com>]
+
   *) mod_proxy_wstunnel: Reliably run before mod_proxy_http.
      [Eric Covener]
 
index 28e01df2976f6bf28bb71dedf5b98542e18f8cb1..06fc3f483bb3d2f40ae2c61801acb7bf9e86ee73 100644 (file)
@@ -394,6 +394,9 @@ static int remoteip_modify_request(request_rec *r)
         return OK;
     }
 
+    /* Port is not known so set it to zero; otherwise it can be misleading */
+    req->useragent_addr->port = 0;
+
     req->proxied_remote = remote;
     req->proxy_ips = proxy_ips;