From e42ecdc54556c4852ca06b1a6da6c1ccbf3f522e Mon Sep 17 00:00:00 2001 From: Adrian Granados Date: Wed, 28 Feb 2018 04:11:17 -0500 Subject: [PATCH] Add BlockAck Request subtype for addr2 conditional field clause (#1175) * Fixed parsing of addr2 (TA) for BlockAck Request frames. * Unit test for addr2 dissect in BlockAck Request frames. --- scapy/layers/dot11.py | 2 +- test/regression.uts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scapy/layers/dot11.py b/scapy/layers/dot11.py index 8064a9002..a5510ac6e 100644 --- a/scapy/layers/dot11.py +++ b/scapy/layers/dot11.py @@ -123,7 +123,7 @@ class Dot11(Packet): ConditionalField( MACField("addr2", ETHER_ANY), lambda pkt: (pkt.type != 1 or - pkt.subtype in [0x9, 0xb, 0xa, 0xe, 0xf]), + pkt.subtype in [0x8, 0x9, 0xa, 0xb, 0xe, 0xf]), ), ConditionalField( MACField("addr3", ETHER_ANY), diff --git a/test/regression.uts b/test/regression.uts index 3556b1c73..d7ebbc740 100644 --- a/test/regression.uts +++ b/test/regression.uts @@ -9378,6 +9378,7 @@ Dot11(type=0, subtype=1).answers(query) == True = Dot11 - misc assert Dot11Elt(info="scapy").summary() == "SSID='scapy'" assert Dot11Elt(ID=1).mysummary() == "" +assert Dot11(b'\x84\x00\x00\x00\x00\x11\x22\x33\x44\x55\x00\x11\x22\x33\x44\x55').addr2 == '00:11:22:33:44:55' = Multiple Dot11Elt layers pkt = Dot11() / Dot11Beacon() / Dot11Elt(ID="Rates") / Dot11Elt(ID="SSID", info="Scapy")