Hi Andrew, hi everyone,
On lun, mag 09, 2011 at 04:48:12 +0200, Andrew Lunn wrote:
- while (*p != 255 && !ret) {
/* p now points to the first octect: option type */
if (*p == 53) {
/* type 53 is the message type option.
* Jump the len octect and go to the data octect */
if (pkt_len < 2)
goto out;
pkt_len -= 2;
p += 2;
/* check if the message type is what we need */
if (*p == DHCP_REQUEST)
ret = true;
Why do you continue parsing the options if it is not a DHCP_REQUEST? Do you think there will be a second, third, fourth option information element 53?
No. There is no reason to continue parsing the options. I'll modify the if so that I can exit the while loop as soon as I find the option 53.
Thanks for finding this detail!
Regards,