提交 c70b921f 编写于 作者: J Jeremy Sowden 提交者: Florian Westphal

netfilter: bitwise: replace hard-coded size with `sizeof` expression

When calculating the length of an array, use the appropriate `sizeof`
expression for its type, rather than an integer literal.
Signed-off-by: NJeremy Sowden <jeremy@azazel.net>
Signed-off-by: NFlorian Westphal <fw@strlen.de>
上级 c3e34866
...@@ -30,7 +30,7 @@ static void nft_bitwise_eval_bool(u32 *dst, const u32 *src, ...@@ -30,7 +30,7 @@ static void nft_bitwise_eval_bool(u32 *dst, const u32 *src,
{ {
unsigned int i; unsigned int i;
for (i = 0; i < DIV_ROUND_UP(priv->len, 4); i++) for (i = 0; i < DIV_ROUND_UP(priv->len, sizeof(u32)); i++)
dst[i] = (src[i] & priv->mask.data[i]) ^ priv->xor.data[i]; dst[i] = (src[i] & priv->mask.data[i]) ^ priv->xor.data[i];
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册