PACKET ALIGNMENT(9)
π Packet alignment π
okay so this is from the Kernel API Manual, and bestie, itβs literally the alignment gossip you need. β¨ Drivers always need to pass packets that are aligned to two-byte boundaries to the stack. no cap, thatβs the baseline. π
Additionally, they should, if possible, align the payload data in a way that guarantees that the contained IP header is aligned to a four-byte boundary. π
For regular frames, this simply means aligning the payload to a four-byte boundary β because either the IP header is directly contained, or IV/RFC1042 headers that have a length divisible by four are in front of it. πΈ easy enough, right?
If the payload data is not properly aligned and the architecture doesnβt support efficient unaligned operations, mac80211 will align the data. okay so mac80211 is the friend who fixes your outfit in the bathroom mirror, got it. πͺπ
With A-MSDU frames, though, the payload data address must yield two modulo four, because there are 14-byte 802.3 headers within the A-MSDU frames that push the IP header further back to a multiple of four again. π₯ math behavior, honestly.
Thankfully, the specs were sane enough this time around to require padding each A-MSDU subframe to a length that is a multiple of four. periodt. β
π¨ not supported, bestie: padding likeAtheroshardware adds, which is between the802.11header and the payload. in that case, the driver is required to move the802.11header to be directly in front of the payload. π
π SEE ALSO π
- Kernel file:
./net/mac80211/rx.cβ go peek, iykyk. π¦
π this cutie comes from ./net/mac80211 and is dated October 2026 β mwah, bye bestie! π«Άβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms