opt->type & (STRING | RFC3442 | RFC5969))
return 0;
+ if (opt->type & IPV4 && opt->type & ARRAY)
+ return (dl % sizeof(uint32_t) == 0 ? 0 : -1);
+
sz = 0;
if (opt->type & (UINT32 | IPV4))
sz = sizeof(uint32_t);
sz = sizeof(uint16_t);
if (opt->type & UINT8)
sz = sizeof(uint8_t);
- if (opt->type & (IPV4 | ARRAY))
- sz = dl % sizeof(uint32_t);
- return (dl == sz ? 0 : -1);
+ /* If we don't know the size, assume it's valid */
+ return (sz == 0 || dl == sz ? 0 : -1);
}
/* unknown option, so let it pass */