Skip to content
Commit 006e0613 authored by Hugo Benichi's avatar Hugo Benichi
Browse files

Reject DHCP packets with no magic cookie

This patch adds an explicit check in the DHCP packet parser for
rejecting packets without a magic cookie, instead of relying on the
top-level try-catch-all in the parser.

This allows to add to DHCP error metrics this specific error.

It also allows to add two poor man's fuzzing tests that tries to find
additional gaps in the DHCP packet parser by
 - trying to parse all subslices of a valid offer packet.
 - trying to parse random byte arrays.

Test: covered by previously introduced malformed DHCP packet unit tests
      + additional fuzzing tests.
Bug: 31850211
Change-Id: If53c9ba9df78d7604ec018c9d67c237ae59c4833
parent e0ea7fec
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment