]> granicus.if.org Git - apache/commitdiff
Merge r1776458 from trunk:
authorYann Ylavic <ylavic@apache.org>
Wed, 6 Jun 2018 10:56:19 +0000 (10:56 +0000)
committerYann Ylavic <ylavic@apache.org>
Wed, 6 Jun 2018 10:56:19 +0000 (10:56 +0000)
mod_remoteip: Set useragent port to zero PR59931

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>
Reviewed by: ylavic, covener, icing

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1833007 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/metadata/mod_remoteip.c

diff --git a/CHANGES b/CHANGES
index b9bbc876b96d49f2272265619e23809466a9e0d9..ca1132c5b76164109576321b0f03cb9bacb93d85 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.4.34
 
+  *) 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>]
+
   *) core: In ONE_PROCESS/debug mode, cleanup everything when exiting.
      [Yann Ylavic]
 
index e67ff3655f376b7590a42d5f9ab26e012ef42d8e..d4f710425ea007f820db6a87e76eee9273c510f3 100644 (file)
@@ -727,6 +727,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;