[jira] [Commented] (TS-4578) Skip HostDB lookup for all address literals

2016-10-19 Thread Alan M. Carroll (JIRA)

[ 
https://issues.apache.org/jira/browse/TS-4578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15589298#comment-15589298
 ] 

Alan M. Carroll commented on TS-4578:
-

I don't think those functions are useful. It would be better to modify 
{{ats_ip_pton}} to work like those if you pass {{nullptr}} for the {{addr}} 
parameter. In this case in particular {{ats_ip_pton}} is required because the 
resulting IP address is needed to connect to the origin server - this is the 
source of it in this case.

> Skip HostDB lookup for all address literals
> ---
>
> Key: TS-4578
> URL: https://issues.apache.org/jira/browse/TS-4578
> Project: Traffic Server
>  Issue Type: Improvement
>  Components: Core, DNS
>Reporter: James Peach
>Assignee: David Ben Zakai
>  Labels: newbie
> Fix For: sometime
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> In {{HttpSM.cc}}:
> {code}
> if ((strncmp(t_state.dns_info.lookup_name, "127.0.0.1", 9) == 0 || 
> strncmp(t_state.dns_info.lookup_name, "::1", 3) == 0) &&
> ats_ip_pton(t_state.dns_info.lookup_name, t_state.host_db_info.ip()) 
> == 0) {
>   // If it's 127.0.0.1 or ::1 don't bother with hostdb
>   DebugSM("dns", "[HttpTransact::HandleRequest] Skipping DNS lookup for 
> %s because it's loopback",
>   t_state.dns_info.lookup_name);
>   t_state.dns_info.lookup_success = true;
>   call_transact_and_set_next_state(NULL);
>   break;
> {code}
> There's no reason to restrict address literals to loopback. It seems like we 
> should be able to do this for all address literals.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TS-4578) Skip HostDB lookup for all address literals

2016-10-05 Thread James Peach (JIRA)

[ 
https://issues.apache.org/jira/browse/TS-4578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15549098#comment-15549098
 ] 

James Peach commented on TS-4578:
-

Wai, I opened this? I wonder why I did that? On further investigation, the IP 
address literal is handled in {{HostDBContinuation::do_dns()}}, so other than 
for the performance claim in  TS-3366, I'm not sure there is a good reason to 
do this.

> Skip HostDB lookup for all address literals
> ---
>
> Key: TS-4578
> URL: https://issues.apache.org/jira/browse/TS-4578
> Project: Traffic Server
>  Issue Type: Improvement
>  Components: Core, DNS
>Reporter: James Peach
>Assignee: David Ben Zakai
>  Labels: newbie
> Fix For: sometime
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> In {{HttpSM.cc}}:
> {code}
> if ((strncmp(t_state.dns_info.lookup_name, "127.0.0.1", 9) == 0 || 
> strncmp(t_state.dns_info.lookup_name, "::1", 3) == 0) &&
> ats_ip_pton(t_state.dns_info.lookup_name, t_state.host_db_info.ip()) 
> == 0) {
>   // If it's 127.0.0.1 or ::1 don't bother with hostdb
>   DebugSM("dns", "[HttpTransact::HandleRequest] Skipping DNS lookup for 
> %s because it's loopback",
>   t_state.dns_info.lookup_name);
>   t_state.dns_info.lookup_success = true;
>   call_transact_and_set_next_state(NULL);
>   break;
> {code}
> There's no reason to restrict address literals to loopback. It seems like we 
> should be able to do this for all address literals.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TS-4578) Skip HostDB lookup for all address literals

2016-10-04 Thread David Ben Zakai (JIRA)

[ 
https://issues.apache.org/jira/browse/TS-4578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15547637#comment-15547637
 ] 

David Ben Zakai commented on TS-4578:
-

[~jamespeach] Thanks!

> Skip HostDB lookup for all address literals
> ---
>
> Key: TS-4578
> URL: https://issues.apache.org/jira/browse/TS-4578
> Project: Traffic Server
>  Issue Type: Improvement
>  Components: Core, DNS
>Reporter: James Peach
>Assignee: David Ben Zakai
>  Labels: newbie
> Fix For: sometime
>
>
> In {{HttpSM.cc}}:
> {code}
> if ((strncmp(t_state.dns_info.lookup_name, "127.0.0.1", 9) == 0 || 
> strncmp(t_state.dns_info.lookup_name, "::1", 3) == 0) &&
> ats_ip_pton(t_state.dns_info.lookup_name, t_state.host_db_info.ip()) 
> == 0) {
>   // If it's 127.0.0.1 or ::1 don't bother with hostdb
>   DebugSM("dns", "[HttpTransact::HandleRequest] Skipping DNS lookup for 
> %s because it's loopback",
>   t_state.dns_info.lookup_name);
>   t_state.dns_info.lookup_success = true;
>   call_transact_and_set_next_state(NULL);
>   break;
> {code}
> There's no reason to restrict address literals to loopback. It seems like we 
> should be able to do this for all address literals.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TS-4578) Skip HostDB lookup for all address literals

2016-10-04 Thread James Peach (JIRA)

[ 
https://issues.apache.org/jira/browse/TS-4578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15547479#comment-15547479
 ] 

James Peach commented on TS-4578:
-

[~davidbz] take a look at {{ats_ip_pton}}.

> Skip HostDB lookup for all address literals
> ---
>
> Key: TS-4578
> URL: https://issues.apache.org/jira/browse/TS-4578
> Project: Traffic Server
>  Issue Type: Improvement
>  Components: Core, DNS
>Reporter: James Peach
>Assignee: David Ben Zakai
>  Labels: newbie
> Fix For: sometime
>
>
> In {{HttpSM.cc}}:
> {code}
> if ((strncmp(t_state.dns_info.lookup_name, "127.0.0.1", 9) == 0 || 
> strncmp(t_state.dns_info.lookup_name, "::1", 3) == 0) &&
> ats_ip_pton(t_state.dns_info.lookup_name, t_state.host_db_info.ip()) 
> == 0) {
>   // If it's 127.0.0.1 or ::1 don't bother with hostdb
>   DebugSM("dns", "[HttpTransact::HandleRequest] Skipping DNS lookup for 
> %s because it's loopback",
>   t_state.dns_info.lookup_name);
>   t_state.dns_info.lookup_success = true;
>   call_transact_and_set_next_state(NULL);
>   break;
> {code}
> There's no reason to restrict address literals to loopback. It seems like we 
> should be able to do this for all address literals.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TS-4578) Skip HostDB lookup for all address literals

2016-10-04 Thread David Ben Zakai (JIRA)

[ 
https://issues.apache.org/jira/browse/TS-4578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15546105#comment-15546105
 ] 

David Ben Zakai commented on TS-4578:
-

Hi,

I'm thinking about taking this one by adding the following function:

bool
is_valid_ip_address(char *ip_address) {
// try ipv4
struct sockaddr_in sa;
int result = inet_pton(AF_INET, ipAddress, &(sa.sin_addr));

// Try ipv6
if (!result) {
result = inet_pton(AF_INET6, ipAddress, &(sa.sin_addr));
}

return result != 0;
}

I'd like to hear your input. Am I going in the right direction here? (if this 
function is ok with you guys where should I put it?)
Thanks!


> Skip HostDB lookup for all address literals
> ---
>
> Key: TS-4578
> URL: https://issues.apache.org/jira/browse/TS-4578
> Project: Traffic Server
>  Issue Type: Improvement
>  Components: Core, DNS
>Reporter: James Peach
>  Labels: newbie
> Fix For: sometime
>
>
> In {{HttpSM.cc}}:
> {code}
> if ((strncmp(t_state.dns_info.lookup_name, "127.0.0.1", 9) == 0 || 
> strncmp(t_state.dns_info.lookup_name, "::1", 3) == 0) &&
> ats_ip_pton(t_state.dns_info.lookup_name, t_state.host_db_info.ip()) 
> == 0) {
>   // If it's 127.0.0.1 or ::1 don't bother with hostdb
>   DebugSM("dns", "[HttpTransact::HandleRequest] Skipping DNS lookup for 
> %s because it's loopback",
>   t_state.dns_info.lookup_name);
>   t_state.dns_info.lookup_success = true;
>   call_transact_and_set_next_state(NULL);
>   break;
> {code}
> There's no reason to restrict address literals to loopback. It seems like we 
> should be able to do this for all address literals.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TS-4578) Skip HostDB lookup for all address literals

2016-06-27 Thread Leif Hedstrom (JIRA)

[ 
https://issues.apache.org/jira/browse/TS-4578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15351707#comment-15351707
 ] 

Leif Hedstrom commented on TS-4578:
---

This seems like a potential newbie candidate? Couldn't we just check the change 
to see if the name is made up exclusively of 0-9 and "[.:]" (and whatever other 
characters might be allowed in IPv6?)

> Skip HostDB lookup for all address literals
> ---
>
> Key: TS-4578
> URL: https://issues.apache.org/jira/browse/TS-4578
> Project: Traffic Server
>  Issue Type: Improvement
>  Components: Core, DNS
>Reporter: James Peach
>  Labels: newbie
> Fix For: sometime
>
>
> In {{HttpSM.cc}}:
> {code}
> if ((strncmp(t_state.dns_info.lookup_name, "127.0.0.1", 9) == 0 || 
> strncmp(t_state.dns_info.lookup_name, "::1", 3) == 0) &&
> ats_ip_pton(t_state.dns_info.lookup_name, t_state.host_db_info.ip()) 
> == 0) {
>   // If it's 127.0.0.1 or ::1 don't bother with hostdb
>   DebugSM("dns", "[HttpTransact::HandleRequest] Skipping DNS lookup for 
> %s because it's loopback",
>   t_state.dns_info.lookup_name);
>   t_state.dns_info.lookup_success = true;
>   call_transact_and_set_next_state(NULL);
>   break;
> {code}
> There's no reason to restrict address literals to loopback. It seems like we 
> should be able to do this for all address literals.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)