[
https://issues.apache.org/jira/browse/TS-4688?focusedWorklogId=25758&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-25758
]
ASF GitHub Bot logged work on TS-4688:
--------------------------------------
Author: ASF GitHub Bot
Created on: 20/Jul/16 15:01
Start Date: 20/Jul/16 15:01
Worklog Time Spent: 10m
Work Description: Github user jacksontj commented on a diff in the pull
request:
https://github.com/apache/trafficserver/pull/812#discussion_r71542146
--- Diff: iocore/dns/DNS.cc ---
@@ -1514,24 +1514,24 @@ dns_process(DNSHandler *handler, HostEnt *buf, int
len)
cp += dn_skipname(cp, eom);
here = cp; /* hack */
SRV *srv = &buf->srv_hosts.hosts[num_srv];
- int r = ink_ns_name_ntop(srv_off + SRV_SERVER, srv->host,
MAXDNAME);
- if (r <= 0) {
- /* FIXME: is this really an error? or just a continue; */
+
+ // expand the name
+ n = ink_dn_expand((u_char *)h, eom, srv_off + SRV_SERVER, (u_char
*)srv->host, MAXDNAME);
+ if (n < 0) {
++error;
- goto Lerror;
+ break;
}
Debug("dns_srv", "Discovered SRV record [from NS lookup] with
cost:%d weight:%d port:%d with host:%s",
ink_get16(srv_off + SRV_COST), ink_get16(srv_off +
SRV_WEIGHT), ink_get16(srv_off + SRV_PORT), srv->host);
- srv->port = ink_get16(srv_off + SRV_PORT);
- srv->priority = ink_get16(srv_off + SRV_COST);
- srv->weight = ink_get16(srv_off + SRV_WEIGHT);
- srv->host_len = r;
- srv->host[r - 1] = '\0';
- srv->key = makeHostHash(srv->host);
+ srv->port = ink_get16(srv_off + SRV_PORT);
+ srv->priority = ink_get16(srv_off + SRV_COST);
+ srv->weight = ink_get16(srv_off + SRV_WEIGHT);
+ srv->host_len = ::strlen(srv->host) + 1;
--- End diff --
Sadly no, `n` is the length of the compressed string, not the expanded
string-- meaning I have to calculate the len of the expanded string.
Issue Time Tracking
-------------------
Worklog Id: (was: 25758)
Time Spent: 1h 20m (was: 1h 10m)
> DNS resolver doesn't handle DNS compression labels for SRV responses
> --------------------------------------------------------------------
>
> Key: TS-4688
> URL: https://issues.apache.org/jira/browse/TS-4688
> Project: Traffic Server
> Issue Type: Bug
> Components: DNS
> Reporter: Thomas Jackson
> Assignee: Thomas Jackson
> Fix For: 7.0.0
>
> Time Spent: 1h 20m
> Remaining Estimate: 0h
>
> If you get an SRV response from DNS with compression labels-- ATS' resolver
> doesn't expand the names so the lookup fails.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)