Commit 36d4084dc8eb7a9a3655a2041097a46aff3061e9

Authored by Jan Engelhardt
1 parent 9e05ec4b18

netfilter: xtables: remove xt_iprange v0

Superseded by xt_iprange v1 (v2.6.24-2928-g1a50c5a1).

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>

Showing 4 changed files with 2 additions and 69 deletions Side-by-side Diff

Documentation/feature-removal-schedule.txt
... ... @@ -238,10 +238,6 @@
238 238 - "forwarding" header files like ipt_mac.h in
239 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 241 - xt_mark match revision 0
246 242 (superseded by xt_mark match revision 1)
247 243  
include/linux/netfilter_ipv4/Kbuild
... ... @@ -23,7 +23,6 @@
23 23 header-y += ipt_esp.h
24 24 header-y += ipt_hashlimit.h
25 25 header-y += ipt_helper.h
26   -header-y += ipt_iprange.h
27 26 header-y += ipt_length.h
28 27 header-y += ipt_limit.h
29 28 header-y += ipt_mac.h
include/linux/netfilter_ipv4/ipt_iprange.h
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 */
net/netfilter/xt_iprange.c
... ... @@ -14,42 +14,8 @@
14 14 #include <linux/ipv6.h>
15 15 #include <linux/netfilter/x_tables.h>
16 16 #include <linux/netfilter/xt_iprange.h>
17   -#include <linux/netfilter_ipv4/ipt_iprange.h>
18 17  
19 18 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   -
52   -static bool
53 19 iprange_mt4(const struct sk_buff *skb, const struct xt_match_param *par)
54 20 {
55 21 const struct xt_iprange_mtinfo *info = par->matchinfo;
... ... @@ -127,14 +93,6 @@
127 93 static struct xt_match iprange_mt_reg[] __read_mostly = {
128 94 {
129 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 96 .revision = 1,
139 97 .family = NFPROTO_IPV4,
140 98 .match = iprange_mt4,
... ... @@ -164,7 +122,8 @@
164 122 module_init(iprange_mt_init);
165 123 module_exit(iprange_mt_exit);
166 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 127 MODULE_DESCRIPTION("Xtables: arbitrary IPv4 range matching");
169 128 MODULE_ALIAS("ipt_iprange");
170 129 MODULE_ALIAS("ip6t_iprange");