Skip to content

Commit

Permalink
Merge pull request #67 from bobstanden/fix-srv-compression
Browse files Browse the repository at this point in the history
RFC2782, page 3: DNS SRV Target must not be compressed
  • Loading branch information
paulc authored Jul 8, 2024
2 parents eecd741 + 9627f80 commit a0abc9b
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 @@ -1460,7 +1460,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 a0abc9b

Please sign in to comment.