Merge pull request #1041 from p-l-/fix-1009

RDataField treats NS, CNAME as DNS string type.
This commit is contained in:
Pierre Lalet 2018-01-13 00:35:37 +01:00 committed by GitHub
commit 0998b917d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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
if pkt.type == 1: # A
family = socket.AF_INET
elif pkt.type == 12: # PTR
elif pkt.type in [2, 5, 12]: # NS, CNAME, PTR
l = orb(s[0])
if l & 0xc0 and hasattr(pkt, "_orig_s") and pkt._orig_s: # Compression detected
p = ((l & ~0xc0) << 8) + orb(s[1]) - 12