diff --git a/sys/netlink/netlink_generic.c b/sys/netlink/netlink_generic.c --- a/sys/netlink/netlink_generic.c +++ b/sys/netlink/netlink_generic.c @@ -67,7 +67,8 @@ return (ENOTSUP); } - if (__predict_false(hdr->nlmsg_len < sizeof(hdr) + GENL_HDRLEN)) { + if (__predict_false(hdr->nlmsg_len < sizeof(struct nlmsghdr) + + GENL_HDRLEN)) { NLP_LOG(LOG_DEBUG, nlp, "invalid message size: %d", hdr->nlmsg_len); return (EINVAL); }