summaryrefslogtreecommitdiff
path: root/net/core/neighbour.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/core/neighbour.c')
-rw-r--r--net/core/neighbour.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index eae73efa9245..4fc601f9cd06 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1940,6 +1940,9 @@ static int neigh_add(struct sk_buff *skb, struct nlmsghdr *nlh,
NL_SET_ERR_MSG(extack, "Invalid extended flags");
goto out;
}
+ BUILD_BUG_ON(sizeof(neigh->flags) * BITS_PER_BYTE <
+ (sizeof(ndm->ndm_flags) * BITS_PER_BYTE +
+ hweight32(NTF_EXT_MASK)));
ndm_flags |= (ext << NTF_EXT_SHIFT);
}
if (ndm->ndm_ifindex) {