aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter/xt_iprange.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/netfilter/xt_iprange.c')
-rw-r--r--net/netfilter/xt_iprange.c36
1 files changed, 16 insertions, 20 deletions
diff --git a/net/netfilter/xt_iprange.c b/net/netfilter/xt_iprange.c
index 7ac54eab0b0..501f9b62318 100644
--- a/net/netfilter/xt_iprange.c
+++ b/net/netfilter/xt_iprange.c
@@ -26,12 +26,11 @@ iprange_mt_v0(const struct sk_buff *skb, const struct xt_match_param *par)
26 if ((ntohl(iph->saddr) < ntohl(info->src.min_ip) 26 if ((ntohl(iph->saddr) < ntohl(info->src.min_ip)
27 || ntohl(iph->saddr) > ntohl(info->src.max_ip)) 27 || ntohl(iph->saddr) > ntohl(info->src.max_ip))
28 ^ !!(info->flags & IPRANGE_SRC_INV)) { 28 ^ !!(info->flags & IPRANGE_SRC_INV)) {
29 pr_debug("src IP %u.%u.%u.%u NOT in range %s" 29 pr_debug("src IP %pI4 NOT in range %s%pI4-%pI4\n",
30 "%u.%u.%u.%u-%u.%u.%u.%u\n", 30 &iph->saddr,
31 NIPQUAD(iph->saddr),
32 info->flags & IPRANGE_SRC_INV ? "(INV) " : "", 31 info->flags & IPRANGE_SRC_INV ? "(INV) " : "",
33 NIPQUAD(info->src.min_ip), 32 &info->src.min_ip,
34 NIPQUAD(info->src.max_ip)); 33 &info->src.max_ip);
35 return false; 34 return false;
36 } 35 }
37 } 36 }
@@ -39,12 +38,11 @@ iprange_mt_v0(const struct sk_buff *skb, const struct xt_match_param *par)
39 if ((ntohl(iph->daddr) < ntohl(info->dst.min_ip) 38 if ((ntohl(iph->daddr) < ntohl(info->dst.min_ip)
40 || ntohl(iph->daddr) > ntohl(info->dst.max_ip)) 39 || ntohl(iph->daddr) > ntohl(info->dst.max_ip))
41 ^ !!(info->flags & IPRANGE_DST_INV)) { 40 ^ !!(info->flags & IPRANGE_DST_INV)) {
42 pr_debug("dst IP %u.%u.%u.%u NOT in range %s" 41 pr_debug("dst IP %pI4 NOT in range %s%pI4-%pI4\n",
43 "%u.%u.%u.%u-%u.%u.%u.%u\n", 42 &iph->daddr,
44 NIPQUAD(iph->daddr),
45 info->flags & IPRANGE_DST_INV ? "(INV) " : "", 43 info->flags & IPRANGE_DST_INV ? "(INV) " : "",
46 NIPQUAD(info->dst.min_ip), 44 &info->dst.min_ip,
47 NIPQUAD(info->dst.max_ip)); 45 &info->dst.max_ip);
48 return false; 46 return false;
49 } 47 }
50 } 48 }
@@ -63,12 +61,11 @@ iprange_mt4(const struct sk_buff *skb, const struct xt_match_param *par)
63 m |= ntohl(iph->saddr) > ntohl(info->src_max.ip); 61 m |= ntohl(iph->saddr) > ntohl(info->src_max.ip);
64 m ^= !!(info->flags & IPRANGE_SRC_INV); 62 m ^= !!(info->flags & IPRANGE_SRC_INV);
65 if (m) { 63 if (m) {
66 pr_debug("src IP " NIPQUAD_FMT " NOT in range %s" 64 pr_debug("src IP %pI4 NOT in range %s%pI4-%pI4\n",
67 NIPQUAD_FMT "-" NIPQUAD_FMT "\n", 65 &iph->saddr,
68 NIPQUAD(iph->saddr),
69 (info->flags & IPRANGE_SRC_INV) ? "(INV) " : "", 66 (info->flags & IPRANGE_SRC_INV) ? "(INV) " : "",
70 NIPQUAD(info->src_max.ip), 67 &info->src_max.ip,
71 NIPQUAD(info->src_max.ip)); 68 &info->src_max.ip);
72 return false; 69 return false;
73 } 70 }
74 } 71 }
@@ -77,12 +74,11 @@ iprange_mt4(const struct sk_buff *skb, const struct xt_match_param *par)
77 m |= ntohl(iph->daddr) > ntohl(info->dst_max.ip); 74 m |= ntohl(iph->daddr) > ntohl(info->dst_max.ip);
78 m ^= !!(info->flags & IPRANGE_DST_INV); 75 m ^= !!(info->flags & IPRANGE_DST_INV);
79 if (m) { 76 if (m) {
80 pr_debug("dst IP " NIPQUAD_FMT " NOT in range %s" 77 pr_debug("dst IP %pI4 NOT in range %s%pI4-%pI4\n",
81 NIPQUAD_FMT "-" NIPQUAD_FMT "\n", 78 &iph->daddr,
82 NIPQUAD(iph->daddr),
83 (info->flags & IPRANGE_DST_INV) ? "(INV) " : "", 79 (info->flags & IPRANGE_DST_INV) ? "(INV) " : "",
84 NIPQUAD(info->dst_min.ip), 80 &info->dst_min.ip,
85 NIPQUAD(info->dst_max.ip)); 81 &info->dst_max.ip);
86 return false; 82 return false;
87 } 83 }
88 } 84 }