802.11 "FCSField -> cfe" sub-field not in correct place in the FCS field when writing a frame to a file.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 12.6k
- Forks
- 2.2k
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 56
Description
Brief description
In the Dot11 layer, the "FCSField -> cfe" (Control Frame Extension) field occupies bits B12-B15 instead of bits B8-B11 of the FCSField.
Scapy version
2.4.5
Python version
3.8.10
Operating system
Ubuntu 20.04.5 LTS
Additional environment information
No response
How to reproduce
Run the following script to produce the 802.11 frame (python3 -c "import bad_cfe; bad_cfe.bad_cfe()")

Actual result
pkt.show() prints the following (indicating a cfe = 15 and an FCSField set to 1 (pw-mgt).

However, WireShark indicates that the upper and lower 4 bits of the second byte of the frame have been swapped ("FCS-Field -> cfe" == 1 and bits B12-B15 == 15).

Expected result
Byte 2 of the 802.11 frame (Flags) should be 0x1f (PWR MGT == 1, Control Frame Extension == 15), not 0xf1.
Related resources
See paragraph 9.2.4.1.1 Figure 9-3 in the 802.11 - 2016 specification.
The issue seems to be in the SCAPY Dot11 class. Lines 695 - 698 should moved from their current location and inserted after line 710 to get the field order correct.

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect the SCAPY Dot11 class around lines 695–710, where the issue identifies the FCSField sub-field ordering. Reproduce the problem with python3 -c "import bad_cfe; bad_cfe.bad_cfe()" and compare the serialized frame with the displayed fields. Done means the second byte is 0x1f rather than 0xf1, with cfe in bits B8–B11.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100