Skip to content

Commit

Permalink
RFC2782, page 3: DNS SRV Target must not be compressed. No name compr…
Browse files Browse the repository at this point in the history
…ession, line 1457 dns.py

Added SRV and NSEC to list of RR using no name compression, line 297 label.py
  • Loading branch information
Bob Standen committed Jun 23, 2024
1 parent 724f94e commit 9627f80
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dnslib/dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -1454,7 +1454,7 @@ def get_target(self):

def pack(self,buffer):
buffer.pack("!HHH",self.priority,self.weight,self.port)
buffer.encode_name(self.target)
buffer.encode_name_nocompress(self.target)

def __repr__(self):
return "%d %d %d %s" % (self.priority,self.weight,self.port,self.target)
Expand Down
2 changes: 1 addition & 1 deletion dnslib/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def encode_name(self,name):
def encode_name_nocompress(self,name):
"""
Encode and store label with no compression
(needed for RRSIG)
(needed for RRSIG, SRV, NSEC)
"""
if not isinstance(name,DNSLabel):
name = DNSLabel(name)
Expand Down

0 comments on commit 9627f80

Please sign in to comment.