Skip to content

Conversation

simeonmiteff
Copy link
Contributor

This fixes two bugs in the Geneve implementation:

  • The decoder was using an incorrect number of bits for the option length field
  • The encoder was generating corrupt packets on serialisation due to uninitialised buffer use

Simeon Miteff added 2 commits June 1, 2023 13:45
The option header length is 5 bits, not 4, so fix the bit shift for
decoding flags, and fix the mask for decoding the length. This also adds
a unit test for decoding a max length option (124 byte payload).
OR-assigning the flag bits into the byte offset for the Geneve option
header flags/length field produced corrupt packets because the buffer
returned by PrependBytes is not guaranteed to be zeroed out. Since this
is the first time that offset is touched, just assign instead.
@mosajjal
Copy link
Contributor

hey mate. is this a draft or ready to be merged?

@simeonmiteff
Copy link
Contributor Author

hey mate. is this a draft or ready to be merged?

G'day 😉 - ready to be merged!

@mosajjal mosajjal merged commit 4472aec into gopacket:master Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants