aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/xt_u32.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/net/netfilter/xt_u32.c b/net/netfilter/xt_u32.c
index 9b8ed390a8e0..627e0f336d54 100644
--- a/net/netfilter/xt_u32.c
+++ b/net/netfilter/xt_u32.c
@@ -26,7 +26,6 @@ static bool u32_match_it(const struct xt_u32 *data,
26 u_int32_t pos; 26 u_int32_t pos;
27 u_int32_t val; 27 u_int32_t val;
28 u_int32_t at; 28 u_int32_t at;
29 int ret;
30 29
31 /* 30 /*
32 * Small example: "0 >> 28 == 4 && 8 & 0xFF0000 >> 16 = 6, 17" 31 * 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 if (skb->len < 4 || pos > skb->len - 4) 39 if (skb->len < 4 || pos > skb->len - 4)
41 return false; 40 return false;
42 41
43 ret = skb_copy_bits(skb, pos, &n, sizeof(n)); 42 if (skb_copy_bits(skb, pos, &n, sizeof(n)) < 0)
44 BUG_ON(ret < 0); 43 BUG();
45 val = ntohl(n); 44 val = ntohl(n);
46 nnums = ct->nnums; 45 nnums = ct->nnums;
47 46
@@ -67,9 +66,9 @@ static bool u32_match_it(const struct xt_u32 *data,
67 pos > skb->len - at - 4) 66 pos > skb->len - at - 4)
68 return false; 67 return false;
69 68
70 ret = skb_copy_bits(skb, at + pos, &n, 69 if (skb_copy_bits(skb, at + pos, &n,
71 sizeof(n)); 70 sizeof(n)) < 0)
72 BUG_ON(ret < 0); 71 BUG();
73 val = ntohl(n); 72 val = ntohl(n);
74 break; 73 break;
75 } 74 }