dhcp: get_option_uint32/16 only accept options with correct len
RFC8925 mentions "The client MUST ignore the IPv6-Only Preferred option if the length field value is not 4."
I'm not modifying get_option_uint8 now as it's also used to read variant length options. Please suggest if you have other preferred way to fix this (such as adding another helper that does not verify the length)
I'm not modifying get_option_uint8 now as it's also used to read variant length options. Please suggest if you have other preferred way to fix this (such as adding another helper that does not verify the length)
That would be the correct way I think. We have two calls that use the uint8 function just to check the existence of an option so we could have a new function that does just that.
Enforcing len==1 in get_option_uint8 as well, and using get_option instead in the mentioned occurrences.
Heh, I should look at the larger picture some more. Thanks for your work and replies.