Skip to content

Commit 4b39624

Browse files
committed
Rename unaccessible FCfields
This fixes #4628
1 parent ef72e1d commit 4b39624

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

scapy/layers/dot11.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ class Dot11(Packet):
708708
[
709709
(
710710
FlagsField("FCfield", 0, 4,
711-
["pw-mgt", "MD", "protected", "order"]),
711+
["pw_mgt", "MD", "protected", "order"]),
712712
lambda pkt: (pkt.type, pkt.subtype) == (1, 6)
713713
),
714714
(
@@ -718,8 +718,8 @@ class Dot11(Packet):
718718
)
719719
],
720720
FlagsField("FCfield", 0, 8,
721-
["to-DS", "from-DS", "MF", "retry",
722-
"pw-mgt", "MD", "protected", "order"])
721+
["to_DS", "from_DS", "MF", "retry",
722+
"pw_mgt", "MD", "protected", "order"])
723723
),
724724
ConditionalField(
725725
BitField("FCfield_bw", 0, 3),
@@ -746,7 +746,7 @@ class Dot11(Packet):
746746
ConditionalField(
747747
_Dot11MacField("addr4", ETHER_ANY, 4),
748748
lambda pkt: (pkt.type == 2 and
749-
pkt.FCfield & 3 == 3), # from-DS+to-DS
749+
pkt.FCfield & 3 == 3), # from_DS+to_DS
750750
)
751751
]
752752

test/scapy/layers/dot11.uts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ assert raw(PPI()/Dot11(type=2, subtype=8, FCfield=0x40)/Dot11QoS()/Dot11WEP()) =
9999
conf.wepkey = "test123"
100100
a = PPI(b'\x00\x00\x08\x00i\x00\x00\x00\x88@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x008(^a')
101101
assert a[Dot11QoS][Dot11WEP].icv == 942169697
102+
assert not a[Dot11].FCfield.to_DS
102103

103104
= Dot11TKIP - dissection
104105

0 commit comments

Comments
 (0)