Updated Branches: refs/heads/master db6e18589 -> 441413b3a
TS-1167: Make parent SOCKS server setup IPv6 compliant. Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/441413b3 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/441413b3 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/441413b3 Branch: refs/heads/master Commit: 441413b3a3ffc623365894ee7f9f9bc0e3119a5b Parents: db6e185 Author: Alan M. Carroll <[email protected]> Authored: Wed Mar 28 11:09:08 2012 -0500 Committer: Alan M. Carroll <[email protected]> Committed: Wed Mar 28 11:09:08 2012 -0500 ---------------------------------------------------------------------- CHANGES | 5 +++++ proxy/ParentSelection.cc | 15 +++++---------- 2 files changed, 10 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/441413b3/CHANGES ---------------------------------------------------------------------- diff --git a/CHANGES b/CHANGES index ccaed32..9b36f98 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ -*- coding: utf-8 -*- Changes with Apache Traffic Server 3.1.4 + + *) [TS-1167] Updates parent socks server setup to be IPv6 compliant. + + *) [TS-1166] Remove proxy/Stuffer.[cc,h] because they were unused. + *) [TS-1162] UnixNetVConnection assertion when accepting a TLS connection *) [TS-1135] support wildcard certificates for ServerNameIndication (SNI) http://git-wip-us.apache.org/repos/asf/trafficserver/blob/441413b3/proxy/ParentSelection.cc ---------------------------------------------------------------------- diff --git a/proxy/ParentSelection.cc b/proxy/ParentSelection.cc index 09a936a..0840c37 100644 --- a/proxy/ParentSelection.cc +++ b/proxy/ParentSelection.cc @@ -958,19 +958,14 @@ setup_socks_servers(ParentRecord * rec_arr, int len) int n_parents = rec_arr[j].num_parents; for (int i = 0; i < n_parents; i++) { - uint32_t bad_ip = (uint32_t) - 1; - uint8_t *ip; - - ink_gethostbyname_r_data data; - struct hostent *ent = ink_gethostbyname_r(pr[i].hostname, &data); - - if (ent) { - ip = (uint8_t *) ent->h_addr_list[0]; + IpEndpoint ip4, ip6; + if (0 == ats_ip_getbestaddrinfo(pr[i].hostname, &ip4, &ip6)) { + IpEndpoint* ip = ats_is_ip6(&ip6) ? &ip6 : &ip4; + ats_ip_ntop(ip, pr[i].hostname, MAXDNAME+1); } else { Warning("Could not resolve socks server name \"%s\". " "Please correct it", pr[i].hostname); - ip = (uint8_t *) & bad_ip; + snprintf(pr[i].hostname, MAXDNAME+1, "255.255.255.255"); } - snprintf(pr[i].hostname, MAXDNAME + 1, "%hhu.%hhu.%hhu.%hhu", ip[0], ip[1], ip[2], ip[3]); } }
