kbandla / dpkt

fast, simple packet creation / parsing, with definitions for the basic TCP/IP protocols
Other
1.08k stars 270 forks source link

Support NS TCP flag from RFC 3540 #572

Closed obormot closed 3 years ago

obormot commented 3 years ago

Describe the bug I noticed the TCP parser is outdated in that it only captures the lower 8-bit TCP flags and the 9th-bit Nonce Sum flag introduced in RFC 3540 won't work.

     0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
   |               |           | N | C | E | U | A | P | R | S | F |
   | Header Length | Reserved  | S | W | C | R | C | S | S | Y | I |
   |               |           |   | R | E | G | K | H | T | N | N |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+

   Figure 3: The new definition of bytes 13 and 14 of the TCP Header.