diff options
-rw-r--r-- | Documentation/feature-removal-schedule.txt | 4 | ||||
-rw-r--r-- | include/linux/netfilter_ipv4/Kbuild | 1 | ||||
-rw-r--r-- | include/linux/netfilter_ipv4/ipt_iprange.h | 21 | ||||
-rw-r--r-- | net/netfilter/xt_iprange.c | 45 |
4 files changed, 2 insertions, 69 deletions
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 6746473ef033..8862b037f0ac 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -238,10 +238,6 @@ What (Why): | |||
238 | - "forwarding" header files like ipt_mac.h in | 238 | - "forwarding" header files like ipt_mac.h in |
239 | include/linux/netfilter_ipv4/ and include/linux/netfilter_ipv6/ | 239 | include/linux/netfilter_ipv4/ and include/linux/netfilter_ipv6/ |
240 | 240 | ||
241 | - xt_iprange match revision 0, | ||
242 | include/linux/netfilter_ipv4/ipt_iprange.h | ||
243 | (superseded by xt_iprange match revision 1) | ||
244 | |||
245 | - xt_mark match revision 0 | 241 | - xt_mark match revision 0 |
246 | (superseded by xt_mark match revision 1) | 242 | (superseded by xt_mark match revision 1) |
247 | 243 | ||
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild index 86d81a285f9c..5e361ef44e87 100644 --- a/include/linux/netfilter_ipv4/Kbuild +++ b/include/linux/netfilter_ipv4/Kbuild | |||
@@ -23,7 +23,6 @@ header-y += ipt_ecn.h | |||
23 | header-y += ipt_esp.h | 23 | header-y += ipt_esp.h |
24 | header-y += ipt_hashlimit.h | 24 | header-y += ipt_hashlimit.h |
25 | header-y += ipt_helper.h | 25 | header-y += ipt_helper.h |
26 | header-y += ipt_iprange.h | ||
27 | header-y += ipt_length.h | 26 | header-y += ipt_length.h |
28 | header-y += ipt_limit.h | 27 | header-y += ipt_limit.h |
29 | header-y += ipt_mac.h | 28 | header-y += ipt_mac.h |
diff --git a/include/linux/netfilter_ipv4/ipt_iprange.h b/include/linux/netfilter_ipv4/ipt_iprange.h deleted file mode 100644 index 5f1aebde4d2f..000000000000 --- a/include/linux/netfilter_ipv4/ipt_iprange.h +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | #ifndef _IPT_IPRANGE_H | ||
2 | #define _IPT_IPRANGE_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <linux/netfilter/xt_iprange.h> | ||
6 | |||
7 | struct ipt_iprange { | ||
8 | /* Inclusive: network order. */ | ||
9 | __be32 min_ip, max_ip; | ||
10 | }; | ||
11 | |||
12 | struct ipt_iprange_info | ||
13 | { | ||
14 | struct ipt_iprange src; | ||
15 | struct ipt_iprange dst; | ||
16 | |||
17 | /* Flags from above */ | ||
18 | u_int8_t flags; | ||
19 | }; | ||
20 | |||
21 | #endif /* _IPT_IPRANGE_H */ | ||
diff --git a/net/netfilter/xt_iprange.c b/net/netfilter/xt_iprange.c index 501f9b623188..ffc96387d556 100644 --- a/net/netfilter/xt_iprange.c +++ b/net/netfilter/xt_iprange.c | |||
@@ -14,40 +14,6 @@ | |||
14 | #include <linux/ipv6.h> | 14 | #include <linux/ipv6.h> |
15 | #include <linux/netfilter/x_tables.h> | 15 | #include <linux/netfilter/x_tables.h> |
16 | #include <linux/netfilter/xt_iprange.h> | 16 | #include <linux/netfilter/xt_iprange.h> |
17 | #include <linux/netfilter_ipv4/ipt_iprange.h> | ||
18 | |||
19 | static bool | ||
20 | iprange_mt_v0(const struct sk_buff *skb, const struct xt_match_param *par) | ||
21 | { | ||
22 | const struct ipt_iprange_info *info = par->matchinfo; | ||
23 | const struct iphdr *iph = ip_hdr(skb); | ||
24 | |||
25 | if (info->flags & IPRANGE_SRC) { | ||
26 | if ((ntohl(iph->saddr) < ntohl(info->src.min_ip) | ||
27 | || ntohl(iph->saddr) > ntohl(info->src.max_ip)) | ||
28 | ^ !!(info->flags & IPRANGE_SRC_INV)) { | ||
29 | pr_debug("src IP %pI4 NOT in range %s%pI4-%pI4\n", | ||
30 | &iph->saddr, | ||
31 | info->flags & IPRANGE_SRC_INV ? "(INV) " : "", | ||
32 | &info->src.min_ip, | ||
33 | &info->src.max_ip); | ||
34 | return false; | ||
35 | } | ||
36 | } | ||
37 | if (info->flags & IPRANGE_DST) { | ||
38 | if ((ntohl(iph->daddr) < ntohl(info->dst.min_ip) | ||
39 | || ntohl(iph->daddr) > ntohl(info->dst.max_ip)) | ||
40 | ^ !!(info->flags & IPRANGE_DST_INV)) { | ||
41 | pr_debug("dst IP %pI4 NOT in range %s%pI4-%pI4\n", | ||
42 | &iph->daddr, | ||
43 | info->flags & IPRANGE_DST_INV ? "(INV) " : "", | ||
44 | &info->dst.min_ip, | ||
45 | &info->dst.max_ip); | ||
46 | return false; | ||
47 | } | ||
48 | } | ||
49 | return true; | ||
50 | } | ||
51 | 17 | ||
52 | static bool | 18 | static bool |
53 | iprange_mt4(const struct sk_buff *skb, const struct xt_match_param *par) | 19 | iprange_mt4(const struct sk_buff *skb, const struct xt_match_param *par) |
@@ -127,14 +93,6 @@ iprange_mt6(const struct sk_buff *skb, const struct xt_match_param *par) | |||
127 | static struct xt_match iprange_mt_reg[] __read_mostly = { | 93 | static struct xt_match iprange_mt_reg[] __read_mostly = { |
128 | { | 94 | { |
129 | .name = "iprange", | 95 | .name = "iprange", |
130 | .revision = 0, | ||
131 | .family = NFPROTO_IPV4, | ||
132 | .match = iprange_mt_v0, | ||
133 | .matchsize = sizeof(struct ipt_iprange_info), | ||
134 | .me = THIS_MODULE, | ||
135 | }, | ||
136 | { | ||
137 | .name = "iprange", | ||
138 | .revision = 1, | 96 | .revision = 1, |
139 | .family = NFPROTO_IPV4, | 97 | .family = NFPROTO_IPV4, |
140 | .match = iprange_mt4, | 98 | .match = iprange_mt4, |
@@ -164,7 +122,8 @@ static void __exit iprange_mt_exit(void) | |||
164 | module_init(iprange_mt_init); | 122 | module_init(iprange_mt_init); |
165 | module_exit(iprange_mt_exit); | 123 | module_exit(iprange_mt_exit); |
166 | MODULE_LICENSE("GPL"); | 124 | MODULE_LICENSE("GPL"); |
167 | MODULE_AUTHOR("Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>, Jan Engelhardt <jengelh@computergmbh.de>"); | 125 | MODULE_AUTHOR("Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>"); |
126 | MODULE_AUTHOR("Jan Engelhardt <jengelh@medozas.de>"); | ||
168 | MODULE_DESCRIPTION("Xtables: arbitrary IPv4 range matching"); | 127 | MODULE_DESCRIPTION("Xtables: arbitrary IPv4 range matching"); |
169 | MODULE_ALIAS("ipt_iprange"); | 128 | MODULE_ALIAS("ipt_iprange"); |
170 | MODULE_ALIAS("ip6t_iprange"); | 129 | MODULE_ALIAS("ip6t_iprange"); |