Packets are allowed to contain as many bytes of Pad Option as they want.
They have been seen in the wild with 50 bytes of 0, then with more valid
options after...
/*
* Padding / End of options
*/
- if (p[0] == 0) return data_len; /* 0x00 - Padding option */
+ if (p[0] == 0) { /* 0x00 - Padding option */
+ data_len = 1; /* Walk over any consecutive 0x00 */
+ p++; /* for efficiency */
+ while ((p < end) && (p[0] == 0)) {
+ p++;
+ data_len ++;
+ }
+ return data_len;
+ }
if (p[0] == 255) return data_len; /* 0xff - End of options signifier */
/*