[ https://issues.apache.org/jira/browse/TS-3020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14110912#comment-14110912 ]
Patrick McGleenon commented on TS-3020: --------------------------------------- Here it is - there haven't been any significant changes in this file since 3.2 {code} >From ba734420a4adb8a2c68d917ae22dcfa287bf101b Mon Sep 17 00:00:00 2001 From: root <r...@bfs-dl360g8-03-km4.bfs.openwave.com> Date: Tue, 26 Aug 2014 17:32:02 +0100 Subject: [PATCH] fixed Blind Tunnel fake URL for IPv6 --- proxy/http/HttpTransact.cc | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc index b41f4c1..2c6f81a 100644 --- a/proxy/http/HttpTransact.cc +++ b/proxy/http/HttpTransact.cc @@ -613,10 +613,9 @@ HttpTransact::HandleBlindTunnel(State* s) HTTPVersion ver(0, 9); s->hdr_info.client_request.version_set(ver); - struct in_addr dest_addr; - dest_addr.s_addr = s->state_machine->ua_session->get_netvc()->get_local_ip(); + char new_host[INET6_ADDRSTRLEN]; + ats_ip_ntop(s->state_machine->ua_session->get_netvc()->get_local_addr(), new_host, sizeof(new_host)); - char *new_host = inet_ntoa(dest_addr); s->hdr_info.client_request.url_get()->host_set(new_host, strlen(new_host)); s->hdr_info.client_request.url_get()->port_set(s->state_machine->ua_session->get_netvc()->get_local_port()); -- 1.7.1 {code} > Blind Tunnel fake request URL is IPv4 only > ------------------------------------------ > > Key: TS-3020 > URL: https://issues.apache.org/jira/browse/TS-3020 > Project: Traffic Server > Issue Type: Bug > Affects Versions: 3.2.5 > Reporter: Patrick McGleenon > Assignee: Leif Hedstrom > Priority: Minor > Fix For: 5.2.0 > > > HttpTransact::HandleBlindTunnel creates a fake request with HTTP version 0.9 > and CONNECT method. The URL for CONNECT used is created from destination IP > and port - currently this is IPv4 only. > requests with IPv6 destination IP addresses still work fine with the > BlindTunnel since ATS is able to figure out the correct IPv6 destination from > the Host Header of the fake URL. So this is a problem just in the ATS > logging > attached is a suggested patch for 3.2 - the latest version of the file hasn't > changed much since then > {code} > --- trafficserver-3.2.0/proxy/http/HttpTransact.cc 2014-08-15 > 16:05:40.625721000 +0100 > +++ trafficserver-3.2.0.patched/proxy/http/HttpTransact.cc 2014-08-15 > 16:58:23.563658000 +0100 > @@ -615,11 +615,12 @@ > HTTPVersion ver(0, 9); > s->hdr_info.client_request.version_set(ver); > > - struct in_addr dest_addr; > - dest_addr.s_addr = > s->state_machine->ua_session->get_netvc()->get_local_ip(); > - > - char *new_host = inet_ntoa(dest_addr); > + // struct in_addr dest_addr; > > + // dest_addr.s_addr = > s->state_machine->ua_session->get_netvc()->get_local_ip(); > + char new_host[INET6_ADDRSTRLEN]; > + ats_ip_ntop(s->state_machine->ua_session->get_netvc()->get_local_addr(), > new_host, sizeof(new_host)); > s->hdr_info.client_request.url_get()->host_set(new_host, strlen(new_host)); > + > // get_local_port() returns a port number in network order > //opwv- FastPath > // so it needs to be converted to host order (eg, in i386 machine) > //opwv- FastPath > > //s->hdr_info.client_request.url_get()->port_set(ntohs(s->state_machine->ua_session->get_netvc()->get_local_port())); > //opwv- FastPath > {code} > With patch: > IPv4: > Aug 18 09:49:24 - INFO - +++++++++ Proxy's Request +++++++++ > Aug 18 09:49:24 - INFO - -- State Machine Id: 2 > Aug 18 09:49:24 - INFO - CONNECT 10.20.51.53:443 HTTP/1.1^M > Aug 18 09:49:24 - INFO - Host: 10.20.51.53^M > Aug 18 09:49:24 - INFO - Connection: close^M > Aug 18 09:49:24 - INFO - ^M > IPv6: > Aug 18 09:47:18 - INFO - +++++++++ Proxy's Request +++++++++ > Aug 18 09:47:18 - INFO - -- State Machine Id: 0 > Aug 18 09:47:18 - INFO - CONNECT [2001:410:0:51:20d:60ff:fe9c:eec4]:443 > HTTP/1.1^M > Aug 18 09:47:18 - INFO - Host: 2001:410:0:51:20d:60ff:fe9c:eec4^M > Aug 18 09:47:18 - INFO - Connection: close^M > Aug 18 09:47:18 - INFO - ^M > without patch: > Aug 13 14:44:45 - INFO - +++++++++ Proxy's Request +++++++++ > Aug 13 14:44:45 - INFO - -- State Machine Id: 17 > Aug 13 14:44:45 - INFO - CONNECT 0.0.0.0:443 HTTP/1.1^M > Aug 13 14:44:45 - INFO - Host: 2001:410:0:51:20d:60ff:fe9c:eec4^M > Aug 13 14:44:45 - INFO - Connection: close^M > Aug 13 14:44:45 - INFO - ^M -- This message was sent by Atlassian JIRA (v6.2#6252)