Hi,
On Thu, Dec 16, 2010 at 11:23:38AM -0800, Bob Halley wrote:
> The rationale is that we're trying to create singleton rrsets, some of
> which might have actual rdatas, and you need the true class to get the
> right rdata objects created. But fear not, dnspython puts the ANY or
> NONE class from the wire form into the "deleting" attribute of the
> rrset, so you can process the update.
Ah, I see. Thanks, that's a great help.
I'm afraid I've hit on another oddity that's puzzling me. It's
message.py:689 -- it doesn't decode the RDATA when the update RR
class is NONE.
section == self.message.answer
should be
section is self.message.answer
As a meta-point, I think the parser should parse what's in the message
leaving higher layers to apply the semantics of what fields can be
ignored. If that sounds reasonable, I've attached a patch to fix the
==/is problem and move the rdata parsing out of the conditional.
Thanks!
james
--
Times flies like an arrow. Fruit flies like bananas.
--- dnspython-1.9.2/dns/message.py.orig 2010-12-17 20:11:07.000000000 +0000
+++ dnspython-1.9.2/dns/message.py 2010-12-17 20:12:13.000000000 +0000
@@ -684,16 +684,18 @@
rdclass = self.zone_rdclass
else:
deleting = None
+
+ rd = dns.rdata.from_wire(rdclass, rdtype, self.wire,
+ self.current, rdlen,
+ self.message.origin)
+
if deleting == dns.rdataclass.ANY or \
(deleting == dns.rdataclass.NONE and \
- section == self.message.answer):
+ section is self.message.answer):
covers = dns.rdatatype.NONE
- rd = None
else:
- rd = dns.rdata.from_wire(rdclass, rdtype, self.wire,
- self.current, rdlen,
- self.message.origin)
covers = rd.covers()
+
if self.message.xfr and rdtype == dns.rdatatype.SOA:
force_unique = True
rrset = self.message.find_rrset(section, name,
_______________________________________________
dnspython-users mailing list
[email protected]
http://howl.play-bow.org/mailman/listinfo.cgi/dnspython-users