RDataField treats NS, CNAME as DNS string type.

This commit is contained in:
morris 2017-12-26 14:07:35 -08:00 committed by Pierre LALET
parent a995f0f87f
commit 5deed2762c
1 changed files with 1 additions and 1 deletions

2
scapy/layers/dns.py Normal file → Executable file
View File

@ -194,7 +194,7 @@ class RDataField(StrLenField):
family = None family = None
if pkt.type == 1: # A if pkt.type == 1: # A
family = socket.AF_INET family = socket.AF_INET
elif pkt.type == 12: # PTR elif pkt.type in [2, 5, 12]: # NS, CNAME, PTR
l = orb(s[0]) l = orb(s[0])
if l & 0xc0 and hasattr(pkt, "_orig_s") and pkt._orig_s: # Compression detected if l & 0xc0 and hasattr(pkt, "_orig_s") and pkt._orig_s: # Compression detected
p = ((l & ~0xc0) << 8) + orb(s[1]) - 12 p = ((l & ~0xc0) << 8) + orb(s[1]) - 12