You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2012/10/12 06:54:48 UTC

[2/2] git commit: TS-1516: use_client_addr breaks parent proxy configuration

TS-1516: use_client_addr breaks parent proxy configuration

When use_client_addr is configured and a plugin/configuration tells
the ATS to send the transaction to a parent proxy it will try to
connect to the client address.  The parent proxy settings should
override the client IP.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/dba0879a
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/dba0879a
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/dba0879a

Branch: refs/heads/master
Commit: dba0879a59323009ac07f5be836741ee050ffa71
Parents: 34a2bad
Author: Uri Shachar <us...@hotmail.com>
Authored: Thu Oct 11 21:49:23 2012 -0700
Committer: James Peach <jp...@apache.org>
Committed: Thu Oct 11 21:50:44 2012 -0700

----------------------------------------------------------------------
 CHANGES              |    3 +++
 proxy/http/HttpSM.cc |   11 ++++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/dba0879a/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index cfe2274..8cc01cb 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 3.3.1
 
+  *) [TS-1516] use_client_addr breaks parent proxy configuration
+     Author: Uri Shachar.
+
   *) [TS-1518] detect header_rewrite plugin boost dependency
 
   *) [TS-1003] make Prefetch config file reloadable

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/dba0879a/proxy/http/HttpSM.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index f4da17d..fbafa0e 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -6697,15 +6697,16 @@ HttpSM::set_next_state()
         break;
       } else  if (t_state.http_config_param->use_client_target_addr
         && !t_state.url_remap_success
+        && t_state.parent_result.r != PARENT_SPECIFIED
         && t_state.client_info.is_transparent
         && ats_is_ip(addr = t_state.state_machine->ua_session->get_netvc()->get_local_addr())
       ) {
         ip_text_buffer ipb;
-        /* If the connection is client side transparent and the URL
-           was not remapped, we can use the client destination IP
-           address instead of doing a DNS lookup. This is controlled
-           by the 'use_client_target_addr' configuration parameter.
-        */
+        /* If the connection is client side transparent and the URL was not
+         * remapped/directed to parent proxy, we can use the client destination
+         * IP address instead of doing a DNS lookup. This is controlled by the
+         * 'use_client_target_addr' configuration parameter.
+         */
         DebugSM("dns", "[HttpTransact::HandleRequest] Skipping DNS lookup for client supplied target %s.\n", ats_ip_ntop(addr, ipb, sizeof(ipb)));
         ats_ip_copy(t_state.host_db_info.ip(), addr);
         t_state.dns_info.lookup_success = true;