{
size_t v;
- if (len < offsetof(struct bootp, vend)) {
- logerrx("%s: truncated packet (%zu) from %s",
- ifp->name, len, inet_ntoa(*from));
- return;
- }
-
/* Unlikely, but appeases sanitizers. */
if (len > FRAMELEN_MAX) {
logerrx("%s: packet exceeded frame length (%zu) from %s",
logerr(__func__);
return;
}
+
+ if (iov->iov_len < offsetof(struct bootp, vend)) {
+ logerrx("%s: truncated packet (%zu) from %s",
+ ifp->name, iov->iov_len, inet_ntoa(from->sin_addr));
+ return;
+ }
+
state = D_CSTATE(ifp);
if (state == NULL) {
/* Try re-directing it to another interface. */