diff options
author | Simo Sorce <ssorce@redhat.com> | 2008-04-28 16:06:23 -0400 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2008-05-07 14:42:49 -0400 |
commit | 70d5209b11f4a3db2e1791cb5461945327c25493 (patch) | |
tree | b2c12b72330455dc3772b6a73c8797baeb077cda | |
parent | 8e7561cff6df60e470f1a576f8dca3f025db0586 (diff) | |
download | freeipa.git-70d5209b11f4a3db2e1791cb5461945327c25493.tar.gz freeipa.git-70d5209b11f4a3db2e1791cb5461945327c25493.tar.xz freeipa.git-70d5209b11f4a3db2e1791cb5461945327c25493.zip |
Fix a bug in our dns library, do not return the query as a reply if 0 replies were returned.
-rw-r--r-- | ipa-python/dnsclient.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/ipa-python/dnsclient.py b/ipa-python/dnsclient.py index 44dae4d7..58d93d85 100644 --- a/ipa-python/dnsclient.py +++ b/ipa-python/dnsclient.py @@ -365,22 +365,22 @@ def dnsParseResults(results): if not rest: return [] - rr = DNSResult() + qq = DNSResult() (rest, label) = dnsParseLabel(rest, results) if label is None: return [] - if len(rest) < rr.qsize(): + if len(rest) < qq.qsize(): return [] - rr.qunpack(rest) + qq.qunpack(rest) - rest = rest[rr.qsize():] + rest = rest[qq.qsize():] if DEBUG_DNSCLIENT: print "Queried for '%s', class = %d, type = %d." % (label, - rr.dns_class, rr.dns_type) + qq.dns_class, qq.dns_type) for i in xrange(header.dns_ancount + header.dns_nscount + header.dns_arcount): (rest, label) = dnsParseLabel(rest, results) @@ -424,8 +424,6 @@ def dnsParseResults(results): rest = rest[rr.dns_rlength:] rrlist += [rr] - if not rrlist: - rrlist = [rr] return rrlist def query(query, qclass, qtype): |