Commit f449b3b5 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by David S. Miller
Browse files

[NETFILTER]: xt_u32: drop the actually unused variable from u32_match_it



The int ret variable is used only to trigger the BUG_ON() after
the skb_copy_bits() call, so check the call failure directly
and drop the variable.
Signed-off-by: default avatarPavel Emelyanov <xemul@openvz.org>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e2b58a67
...@@ -26,7 +26,6 @@ static bool u32_match_it(const struct xt_u32 *data, ...@@ -26,7 +26,6 @@ static bool u32_match_it(const struct xt_u32 *data,
u_int32_t pos; u_int32_t pos;
u_int32_t val; u_int32_t val;
u_int32_t at; u_int32_t at;
int ret;
/* /*
* Small example: "0 >> 28 == 4 && 8 & 0xFF0000 >> 16 = 6, 17" * Small example: "0 >> 28 == 4 && 8 & 0xFF0000 >> 16 = 6, 17"
...@@ -40,8 +39,8 @@ static bool u32_match_it(const struct xt_u32 *data, ...@@ -40,8 +39,8 @@ static bool u32_match_it(const struct xt_u32 *data,
if (skb->len < 4 || pos > skb->len - 4) if (skb->len < 4 || pos > skb->len - 4)
return false; return false;
ret = skb_copy_bits(skb, pos, &n, sizeof(n)); if (skb_copy_bits(skb, pos, &n, sizeof(n)) < 0)
BUG_ON(ret < 0); BUG();
val = ntohl(n); val = ntohl(n);
nnums = ct->nnums; nnums = ct->nnums;
...@@ -67,9 +66,9 @@ static bool u32_match_it(const struct xt_u32 *data, ...@@ -67,9 +66,9 @@ static bool u32_match_it(const struct xt_u32 *data,
pos > skb->len - at - 4) pos > skb->len - at - 4)
return false; return false;
ret = skb_copy_bits(skb, at + pos, &n, if (skb_copy_bits(skb, at + pos, &n,
sizeof(n)); sizeof(n)) < 0)
BUG_ON(ret < 0); BUG();
val = ntohl(n); val = ntohl(n);
break; break;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment