aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2008-10-08 05:35:01 -0400
committerPatrick McHardy <kaber@trash.net>2008-10-08 05:35:01 -0400
commitee999d8b9573df1b547aacdc6d79f86eb79c25cd (patch)
tree83585a40918ad1ebad17f4a0cfbf5486c02c64d7 /net/ipv4
parent7e9c6eeb136a46dfd941852803b3a9dd78939b69 (diff)
netfilter: x_tables: use NFPROTO_* in extensions
Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/netfilter/arp_tables.c58
-rw-r--r--net/ipv4/netfilter/arpt_mangle.c2
-rw-r--r--net/ipv4/netfilter/arptable_filter.c8
-rw-r--r--net/ipv4/netfilter/ipt_CLUSTERIP.c4
-rw-r--r--net/ipv4/netfilter/ipt_ECN.c2
-rw-r--r--net/ipv4/netfilter/ipt_LOG.c6
-rw-r--r--net/ipv4/netfilter/ipt_MASQUERADE.c2
-rw-r--r--net/ipv4/netfilter/ipt_NETMAP.c2
-rw-r--r--net/ipv4/netfilter/ipt_REDIRECT.c2
-rw-r--r--net/ipv4/netfilter/ipt_REJECT.c2
-rw-r--r--net/ipv4/netfilter/ipt_TTL.c2
-rw-r--r--net/ipv4/netfilter/ipt_ULOG.c4
-rw-r--r--net/ipv4/netfilter/ipt_addrtype.c4
-rw-r--r--net/ipv4/netfilter/ipt_ah.c2
-rw-r--r--net/ipv4/netfilter/ipt_ecn.c2
-rw-r--r--net/ipv4/netfilter/ipt_ttl.c2
16 files changed, 53 insertions, 51 deletions
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c
index 03e83a65aec5..b4a9a1799c94 100644
--- a/net/ipv4/netfilter/arp_tables.c
+++ b/net/ipv4/netfilter/arp_tables.c
@@ -463,7 +463,8 @@ static inline int check_target(struct arpt_entry *e, const char *name)
463 t = arpt_get_target(e); 463 t = arpt_get_target(e);
464 target = t->u.kernel.target; 464 target = t->u.kernel.target;
465 465
466 ret = xt_check_target(target, NF_ARP, t->u.target_size - sizeof(*t), 466 ret = xt_check_target(target, NFPROTO_ARP,
467 t->u.target_size - sizeof(*t),
467 name, e->comefrom, 0, 0); 468 name, e->comefrom, 0, 0);
468 if (!ret && t->u.kernel.target->checkentry 469 if (!ret && t->u.kernel.target->checkentry
469 && !t->u.kernel.target->checkentry(name, e, target, t->data, 470 && !t->u.kernel.target->checkentry(name, e, target, t->data,
@@ -488,7 +489,8 @@ find_check_entry(struct arpt_entry *e, const char *name, unsigned int size,
488 return ret; 489 return ret;
489 490
490 t = arpt_get_target(e); 491 t = arpt_get_target(e);
491 target = try_then_request_module(xt_find_target(NF_ARP, t->u.user.name, 492 target = try_then_request_module(xt_find_target(NFPROTO_ARP,
493 t->u.user.name,
492 t->u.user.revision), 494 t->u.user.revision),
493 "arpt_%s", t->u.user.name); 495 "arpt_%s", t->u.user.name);
494 if (IS_ERR(target) || !target) { 496 if (IS_ERR(target) || !target) {
@@ -788,7 +790,7 @@ static void compat_standard_from_user(void *dst, void *src)
788 int v = *(compat_int_t *)src; 790 int v = *(compat_int_t *)src;
789 791
790 if (v > 0) 792 if (v > 0)
791 v += xt_compat_calc_jump(NF_ARP, v); 793 v += xt_compat_calc_jump(NFPROTO_ARP, v);
792 memcpy(dst, &v, sizeof(v)); 794 memcpy(dst, &v, sizeof(v));
793} 795}
794 796
@@ -797,7 +799,7 @@ static int compat_standard_to_user(void __user *dst, void *src)
797 compat_int_t cv = *(int *)src; 799 compat_int_t cv = *(int *)src;
798 800
799 if (cv > 0) 801 if (cv > 0)
800 cv -= xt_compat_calc_jump(NF_ARP, cv); 802 cv -= xt_compat_calc_jump(NFPROTO_ARP, cv);
801 return copy_to_user(dst, &cv, sizeof(cv)) ? -EFAULT : 0; 803 return copy_to_user(dst, &cv, sizeof(cv)) ? -EFAULT : 0;
802} 804}
803 805
@@ -815,7 +817,7 @@ static int compat_calc_entry(struct arpt_entry *e,
815 t = arpt_get_target(e); 817 t = arpt_get_target(e);
816 off += xt_compat_target_offset(t->u.kernel.target); 818 off += xt_compat_target_offset(t->u.kernel.target);
817 newinfo->size -= off; 819 newinfo->size -= off;
818 ret = xt_compat_add_offset(NF_ARP, entry_offset, off); 820 ret = xt_compat_add_offset(NFPROTO_ARP, entry_offset, off);
819 if (ret) 821 if (ret)
820 return ret; 822 return ret;
821 823
@@ -866,9 +868,9 @@ static int get_info(struct net *net, void __user *user, int *len, int compat)
866 name[ARPT_TABLE_MAXNAMELEN-1] = '\0'; 868 name[ARPT_TABLE_MAXNAMELEN-1] = '\0';
867#ifdef CONFIG_COMPAT 869#ifdef CONFIG_COMPAT
868 if (compat) 870 if (compat)
869 xt_compat_lock(NF_ARP); 871 xt_compat_lock(NFPROTO_ARP);
870#endif 872#endif
871 t = try_then_request_module(xt_find_table_lock(net, NF_ARP, name), 873 t = try_then_request_module(xt_find_table_lock(net, NFPROTO_ARP, name),
872 "arptable_%s", name); 874 "arptable_%s", name);
873 if (t && !IS_ERR(t)) { 875 if (t && !IS_ERR(t)) {
874 struct arpt_getinfo info; 876 struct arpt_getinfo info;
@@ -878,7 +880,7 @@ static int get_info(struct net *net, void __user *user, int *len, int compat)
878 if (compat) { 880 if (compat) {
879 struct xt_table_info tmp; 881 struct xt_table_info tmp;
880 ret = compat_table_info(private, &tmp); 882 ret = compat_table_info(private, &tmp);
881 xt_compat_flush_offsets(NF_ARP); 883 xt_compat_flush_offsets(NFPROTO_ARP);
882 private = &tmp; 884 private = &tmp;
883 } 885 }
884#endif 886#endif
@@ -901,7 +903,7 @@ static int get_info(struct net *net, void __user *user, int *len, int compat)
901 ret = t ? PTR_ERR(t) : -ENOENT; 903 ret = t ? PTR_ERR(t) : -ENOENT;
902#ifdef CONFIG_COMPAT 904#ifdef CONFIG_COMPAT
903 if (compat) 905 if (compat)
904 xt_compat_unlock(NF_ARP); 906 xt_compat_unlock(NFPROTO_ARP);
905#endif 907#endif
906 return ret; 908 return ret;
907} 909}
@@ -925,7 +927,7 @@ static int get_entries(struct net *net, struct arpt_get_entries __user *uptr,
925 return -EINVAL; 927 return -EINVAL;
926 } 928 }
927 929
928 t = xt_find_table_lock(net, NF_ARP, get.name); 930 t = xt_find_table_lock(net, NFPROTO_ARP, get.name);
929 if (t && !IS_ERR(t)) { 931 if (t && !IS_ERR(t)) {
930 const struct xt_table_info *private = t->private; 932 const struct xt_table_info *private = t->private;
931 933
@@ -967,7 +969,7 @@ static int __do_replace(struct net *net, const char *name,
967 goto out; 969 goto out;
968 } 970 }
969 971
970 t = try_then_request_module(xt_find_table_lock(net, NF_ARP, name), 972 t = try_then_request_module(xt_find_table_lock(net, NFPROTO_ARP, name),
971 "arptable_%s", name); 973 "arptable_%s", name);
972 if (!t || IS_ERR(t)) { 974 if (!t || IS_ERR(t)) {
973 ret = t ? PTR_ERR(t) : -ENOENT; 975 ret = t ? PTR_ERR(t) : -ENOENT;
@@ -1134,7 +1136,7 @@ static int do_add_counters(struct net *net, void __user *user, unsigned int len,
1134 goto free; 1136 goto free;
1135 } 1137 }
1136 1138
1137 t = xt_find_table_lock(net, NF_ARP, name); 1139 t = xt_find_table_lock(net, NFPROTO_ARP, name);
1138 if (!t || IS_ERR(t)) { 1140 if (!t || IS_ERR(t)) {
1139 ret = t ? PTR_ERR(t) : -ENOENT; 1141 ret = t ? PTR_ERR(t) : -ENOENT;
1140 goto free; 1142 goto free;
@@ -1218,7 +1220,7 @@ check_compat_entry_size_and_hooks(struct compat_arpt_entry *e,
1218 entry_offset = (void *)e - (void *)base; 1220 entry_offset = (void *)e - (void *)base;
1219 1221
1220 t = compat_arpt_get_target(e); 1222 t = compat_arpt_get_target(e);
1221 target = try_then_request_module(xt_find_target(NF_ARP, 1223 target = try_then_request_module(xt_find_target(NFPROTO_ARP,
1222 t->u.user.name, 1224 t->u.user.name,
1223 t->u.user.revision), 1225 t->u.user.revision),
1224 "arpt_%s", t->u.user.name); 1226 "arpt_%s", t->u.user.name);
@@ -1232,7 +1234,7 @@ check_compat_entry_size_and_hooks(struct compat_arpt_entry *e,
1232 1234
1233 off += xt_compat_target_offset(target); 1235 off += xt_compat_target_offset(target);
1234 *size += off; 1236 *size += off;
1235 ret = xt_compat_add_offset(NF_ARP, entry_offset, off); 1237 ret = xt_compat_add_offset(NFPROTO_ARP, entry_offset, off);
1236 if (ret) 1238 if (ret)
1237 goto release_target; 1239 goto release_target;
1238 1240
@@ -1333,7 +1335,7 @@ static int translate_compat_table(const char *name,
1333 1335
1334 duprintf("translate_compat_table: size %u\n", info->size); 1336 duprintf("translate_compat_table: size %u\n", info->size);
1335 j = 0; 1337 j = 0;
1336 xt_compat_lock(NF_ARP); 1338 xt_compat_lock(NFPROTO_ARP);
1337 /* Walk through entries, checking offsets. */ 1339 /* Walk through entries, checking offsets. */
1338 ret = COMPAT_ARPT_ENTRY_ITERATE(entry0, total_size, 1340 ret = COMPAT_ARPT_ENTRY_ITERATE(entry0, total_size,
1339 check_compat_entry_size_and_hooks, 1341 check_compat_entry_size_and_hooks,
@@ -1383,8 +1385,8 @@ static int translate_compat_table(const char *name,
1383 ret = COMPAT_ARPT_ENTRY_ITERATE(entry0, total_size, 1385 ret = COMPAT_ARPT_ENTRY_ITERATE(entry0, total_size,
1384 compat_copy_entry_from_user, 1386 compat_copy_entry_from_user,
1385 &pos, &size, name, newinfo, entry1); 1387 &pos, &size, name, newinfo, entry1);
1386 xt_compat_flush_offsets(NF_ARP); 1388 xt_compat_flush_offsets(NFPROTO_ARP);
1387 xt_compat_unlock(NF_ARP); 1389 xt_compat_unlock(NFPROTO_ARP);
1388 if (ret) 1390 if (ret)
1389 goto free_newinfo; 1391 goto free_newinfo;
1390 1392
@@ -1420,8 +1422,8 @@ out:
1420 COMPAT_ARPT_ENTRY_ITERATE(entry0, total_size, compat_release_entry, &j); 1422 COMPAT_ARPT_ENTRY_ITERATE(entry0, total_size, compat_release_entry, &j);
1421 return ret; 1423 return ret;
1422out_unlock: 1424out_unlock:
1423 xt_compat_flush_offsets(NF_ARP); 1425 xt_compat_flush_offsets(NFPROTO_ARP);
1424 xt_compat_unlock(NF_ARP); 1426 xt_compat_unlock(NFPROTO_ARP);
1425 goto out; 1427 goto out;
1426} 1428}
1427 1429
@@ -1607,8 +1609,8 @@ static int compat_get_entries(struct net *net,
1607 return -EINVAL; 1609 return -EINVAL;
1608 } 1610 }
1609 1611
1610 xt_compat_lock(NF_ARP); 1612 xt_compat_lock(NFPROTO_ARP);
1611 t = xt_find_table_lock(net, NF_ARP, get.name); 1613 t = xt_find_table_lock(net, NFPROTO_ARP, get.name);
1612 if (t && !IS_ERR(t)) { 1614 if (t && !IS_ERR(t)) {
1613 const struct xt_table_info *private = t->private; 1615 const struct xt_table_info *private = t->private;
1614 struct xt_table_info info; 1616 struct xt_table_info info;
@@ -1623,13 +1625,13 @@ static int compat_get_entries(struct net *net,
1623 private->size, get.size); 1625 private->size, get.size);
1624 ret = -EAGAIN; 1626 ret = -EAGAIN;
1625 } 1627 }
1626 xt_compat_flush_offsets(NF_ARP); 1628 xt_compat_flush_offsets(NFPROTO_ARP);
1627 module_put(t->me); 1629 module_put(t->me);
1628 xt_table_unlock(t); 1630 xt_table_unlock(t);
1629 } else 1631 } else
1630 ret = t ? PTR_ERR(t) : -ENOENT; 1632 ret = t ? PTR_ERR(t) : -ENOENT;
1631 1633
1632 xt_compat_unlock(NF_ARP); 1634 xt_compat_unlock(NFPROTO_ARP);
1633 return ret; 1635 return ret;
1634} 1636}
1635 1637
@@ -1709,7 +1711,7 @@ static int do_arpt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len
1709 break; 1711 break;
1710 } 1712 }
1711 1713
1712 try_then_request_module(xt_find_revision(NF_ARP, rev.name, 1714 try_then_request_module(xt_find_revision(NFPROTO_ARP, rev.name,
1713 rev.revision, 1, &ret), 1715 rev.revision, 1, &ret),
1714 "arpt_%s", rev.name); 1716 "arpt_%s", rev.name);
1715 break; 1717 break;
@@ -1787,7 +1789,7 @@ void arpt_unregister_table(struct xt_table *table)
1787static struct xt_target arpt_standard_target __read_mostly = { 1789static struct xt_target arpt_standard_target __read_mostly = {
1788 .name = ARPT_STANDARD_TARGET, 1790 .name = ARPT_STANDARD_TARGET,
1789 .targetsize = sizeof(int), 1791 .targetsize = sizeof(int),
1790 .family = NF_ARP, 1792 .family = NFPROTO_ARP,
1791#ifdef CONFIG_COMPAT 1793#ifdef CONFIG_COMPAT
1792 .compatsize = sizeof(compat_int_t), 1794 .compatsize = sizeof(compat_int_t),
1793 .compat_from_user = compat_standard_from_user, 1795 .compat_from_user = compat_standard_from_user,
@@ -1799,7 +1801,7 @@ static struct xt_target arpt_error_target __read_mostly = {
1799 .name = ARPT_ERROR_TARGET, 1801 .name = ARPT_ERROR_TARGET,
1800 .target = arpt_error, 1802 .target = arpt_error,
1801 .targetsize = ARPT_FUNCTION_MAXNAMELEN, 1803 .targetsize = ARPT_FUNCTION_MAXNAMELEN,
1802 .family = NF_ARP, 1804 .family = NFPROTO_ARP,
1803}; 1805};
1804 1806
1805static struct nf_sockopt_ops arpt_sockopts = { 1807static struct nf_sockopt_ops arpt_sockopts = {
@@ -1821,12 +1823,12 @@ static struct nf_sockopt_ops arpt_sockopts = {
1821 1823
1822static int __net_init arp_tables_net_init(struct net *net) 1824static int __net_init arp_tables_net_init(struct net *net)
1823{ 1825{
1824 return xt_proto_init(net, NF_ARP); 1826 return xt_proto_init(net, NFPROTO_ARP);
1825} 1827}
1826 1828
1827static void __net_exit arp_tables_net_exit(struct net *net) 1829static void __net_exit arp_tables_net_exit(struct net *net)
1828{ 1830{
1829 xt_proto_fini(net, NF_ARP); 1831 xt_proto_fini(net, NFPROTO_ARP);
1830} 1832}
1831 1833
1832static struct pernet_operations arp_tables_net_ops = { 1834static struct pernet_operations arp_tables_net_ops = {
diff --git a/net/ipv4/netfilter/arpt_mangle.c b/net/ipv4/netfilter/arpt_mangle.c
index a385959d2655..3f9e4ccd6168 100644
--- a/net/ipv4/netfilter/arpt_mangle.c
+++ b/net/ipv4/netfilter/arpt_mangle.c
@@ -75,7 +75,7 @@ checkentry(const char *tablename, const void *e, const struct xt_target *target,
75 75
76static struct xt_target arpt_mangle_reg __read_mostly = { 76static struct xt_target arpt_mangle_reg __read_mostly = {
77 .name = "mangle", 77 .name = "mangle",
78 .family = NF_ARP, 78 .family = NFPROTO_ARP,
79 .target = target, 79 .target = target,
80 .targetsize = sizeof(struct arpt_mangle), 80 .targetsize = sizeof(struct arpt_mangle),
81 .checkentry = checkentry, 81 .checkentry = checkentry,
diff --git a/net/ipv4/netfilter/arptable_filter.c b/net/ipv4/netfilter/arptable_filter.c
index 082f5dd3156c..bee3d117661a 100644
--- a/net/ipv4/netfilter/arptable_filter.c
+++ b/net/ipv4/netfilter/arptable_filter.c
@@ -51,7 +51,7 @@ static struct xt_table packet_filter = {
51 .lock = __RW_LOCK_UNLOCKED(packet_filter.lock), 51 .lock = __RW_LOCK_UNLOCKED(packet_filter.lock),
52 .private = NULL, 52 .private = NULL,
53 .me = THIS_MODULE, 53 .me = THIS_MODULE,
54 .af = NF_ARP, 54 .af = NFPROTO_ARP,
55}; 55};
56 56
57/* The work comes in here from netfilter.c */ 57/* The work comes in here from netfilter.c */
@@ -89,21 +89,21 @@ static struct nf_hook_ops arpt_ops[] __read_mostly = {
89 { 89 {
90 .hook = arpt_in_hook, 90 .hook = arpt_in_hook,
91 .owner = THIS_MODULE, 91 .owner = THIS_MODULE,
92 .pf = NF_ARP, 92 .pf = NFPROTO_ARP,
93 .hooknum = NF_ARP_IN, 93 .hooknum = NF_ARP_IN,
94 .priority = NF_IP_PRI_FILTER, 94 .priority = NF_IP_PRI_FILTER,
95 }, 95 },
96 { 96 {
97 .hook = arpt_out_hook, 97 .hook = arpt_out_hook,
98 .owner = THIS_MODULE, 98 .owner = THIS_MODULE,
99 .pf = NF_ARP, 99 .pf = NFPROTO_ARP,
100 .hooknum = NF_ARP_OUT, 100 .hooknum = NF_ARP_OUT,
101 .priority = NF_IP_PRI_FILTER, 101 .priority = NF_IP_PRI_FILTER,
102 }, 102 },
103 { 103 {
104 .hook = arpt_forward_hook, 104 .hook = arpt_forward_hook,
105 .owner = THIS_MODULE, 105 .owner = THIS_MODULE,
106 .pf = NF_ARP, 106 .pf = NFPROTO_ARP,
107 .hooknum = NF_ARP_FORWARD, 107 .hooknum = NF_ARP_FORWARD,
108 .priority = NF_IP_PRI_FILTER, 108 .priority = NF_IP_PRI_FILTER,
109 }, 109 },
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c
index fafe8ebb4c55..63faddc18a1c 100644
--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
+++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
@@ -445,7 +445,7 @@ struct compat_ipt_clusterip_tgt_info
445 445
446static struct xt_target clusterip_tg_reg __read_mostly = { 446static struct xt_target clusterip_tg_reg __read_mostly = {
447 .name = "CLUSTERIP", 447 .name = "CLUSTERIP",
448 .family = AF_INET, 448 .family = NFPROTO_IPV4,
449 .target = clusterip_tg, 449 .target = clusterip_tg,
450 .checkentry = clusterip_tg_check, 450 .checkentry = clusterip_tg_check,
451 .destroy = clusterip_tg_destroy, 451 .destroy = clusterip_tg_destroy,
@@ -546,7 +546,7 @@ arp_mangle(unsigned int hook,
546 546
547static struct nf_hook_ops cip_arp_ops __read_mostly = { 547static struct nf_hook_ops cip_arp_ops __read_mostly = {
548 .hook = arp_mangle, 548 .hook = arp_mangle,
549 .pf = NF_ARP, 549 .pf = NFPROTO_ARP,
550 .hooknum = NF_ARP_OUT, 550 .hooknum = NF_ARP_OUT,
551 .priority = -1 551 .priority = -1
552}; 552};
diff --git a/net/ipv4/netfilter/ipt_ECN.c b/net/ipv4/netfilter/ipt_ECN.c
index d60139c134ca..aee2364afffd 100644
--- a/net/ipv4/netfilter/ipt_ECN.c
+++ b/net/ipv4/netfilter/ipt_ECN.c
@@ -124,7 +124,7 @@ ecn_tg_check(const char *tablename, const void *e_void,
124 124
125static struct xt_target ecn_tg_reg __read_mostly = { 125static struct xt_target ecn_tg_reg __read_mostly = {
126 .name = "ECN", 126 .name = "ECN",
127 .family = AF_INET, 127 .family = NFPROTO_IPV4,
128 .target = ecn_tg, 128 .target = ecn_tg,
129 .targetsize = sizeof(struct ipt_ECN_info), 129 .targetsize = sizeof(struct ipt_ECN_info),
130 .table = "mangle", 130 .table = "mangle",
diff --git a/net/ipv4/netfilter/ipt_LOG.c b/net/ipv4/netfilter/ipt_LOG.c
index 9330ba3577e1..1c9785df4df7 100644
--- a/net/ipv4/netfilter/ipt_LOG.c
+++ b/net/ipv4/netfilter/ipt_LOG.c
@@ -437,7 +437,7 @@ log_tg(struct sk_buff *skb, const struct net_device *in,
437 li.u.log.level = loginfo->level; 437 li.u.log.level = loginfo->level;
438 li.u.log.logflags = loginfo->logflags; 438 li.u.log.logflags = loginfo->logflags;
439 439
440 ipt_log_packet(PF_INET, hooknum, skb, in, out, &li, 440 ipt_log_packet(NFPROTO_IPV4, hooknum, skb, in, out, &li,
441 loginfo->prefix); 441 loginfo->prefix);
442 return XT_CONTINUE; 442 return XT_CONTINUE;
443} 443}
@@ -463,7 +463,7 @@ log_tg_check(const char *tablename, const void *e,
463 463
464static struct xt_target log_tg_reg __read_mostly = { 464static struct xt_target log_tg_reg __read_mostly = {
465 .name = "LOG", 465 .name = "LOG",
466 .family = AF_INET, 466 .family = NFPROTO_IPV4,
467 .target = log_tg, 467 .target = log_tg,
468 .targetsize = sizeof(struct ipt_log_info), 468 .targetsize = sizeof(struct ipt_log_info),
469 .checkentry = log_tg_check, 469 .checkentry = log_tg_check,
@@ -483,7 +483,7 @@ static int __init log_tg_init(void)
483 ret = xt_register_target(&log_tg_reg); 483 ret = xt_register_target(&log_tg_reg);
484 if (ret < 0) 484 if (ret < 0)
485 return ret; 485 return ret;
486 nf_log_register(PF_INET, &ipt_log_logger); 486 nf_log_register(NFPROTO_IPV4, &ipt_log_logger);
487 return 0; 487 return 0;
488} 488}
489 489
diff --git a/net/ipv4/netfilter/ipt_MASQUERADE.c b/net/ipv4/netfilter/ipt_MASQUERADE.c
index 0841aefaa503..9a4822f8243f 100644
--- a/net/ipv4/netfilter/ipt_MASQUERADE.c
+++ b/net/ipv4/netfilter/ipt_MASQUERADE.c
@@ -153,7 +153,7 @@ static struct notifier_block masq_inet_notifier = {
153 153
154static struct xt_target masquerade_tg_reg __read_mostly = { 154static struct xt_target masquerade_tg_reg __read_mostly = {
155 .name = "MASQUERADE", 155 .name = "MASQUERADE",
156 .family = AF_INET, 156 .family = NFPROTO_IPV4,
157 .target = masquerade_tg, 157 .target = masquerade_tg,
158 .targetsize = sizeof(struct nf_nat_multi_range_compat), 158 .targetsize = sizeof(struct nf_nat_multi_range_compat),
159 .table = "nat", 159 .table = "nat",
diff --git a/net/ipv4/netfilter/ipt_NETMAP.c b/net/ipv4/netfilter/ipt_NETMAP.c
index 6739abfd1521..f281500bd7fa 100644
--- a/net/ipv4/netfilter/ipt_NETMAP.c
+++ b/net/ipv4/netfilter/ipt_NETMAP.c
@@ -75,7 +75,7 @@ netmap_tg(struct sk_buff *skb, const struct net_device *in,
75 75
76static struct xt_target netmap_tg_reg __read_mostly = { 76static struct xt_target netmap_tg_reg __read_mostly = {
77 .name = "NETMAP", 77 .name = "NETMAP",
78 .family = AF_INET, 78 .family = NFPROTO_IPV4,
79 .target = netmap_tg, 79 .target = netmap_tg,
80 .targetsize = sizeof(struct nf_nat_multi_range_compat), 80 .targetsize = sizeof(struct nf_nat_multi_range_compat),
81 .table = "nat", 81 .table = "nat",
diff --git a/net/ipv4/netfilter/ipt_REDIRECT.c b/net/ipv4/netfilter/ipt_REDIRECT.c
index 5c6292449d13..ef496105eae1 100644
--- a/net/ipv4/netfilter/ipt_REDIRECT.c
+++ b/net/ipv4/netfilter/ipt_REDIRECT.c
@@ -92,7 +92,7 @@ redirect_tg(struct sk_buff *skb, const struct net_device *in,
92 92
93static struct xt_target redirect_tg_reg __read_mostly = { 93static struct xt_target redirect_tg_reg __read_mostly = {
94 .name = "REDIRECT", 94 .name = "REDIRECT",
95 .family = AF_INET, 95 .family = NFPROTO_IPV4,
96 .target = redirect_tg, 96 .target = redirect_tg,
97 .targetsize = sizeof(struct nf_nat_multi_range_compat), 97 .targetsize = sizeof(struct nf_nat_multi_range_compat),
98 .table = "nat", 98 .table = "nat",
diff --git a/net/ipv4/netfilter/ipt_REJECT.c b/net/ipv4/netfilter/ipt_REJECT.c
index 2639872849da..9f5da0c2cae8 100644
--- a/net/ipv4/netfilter/ipt_REJECT.c
+++ b/net/ipv4/netfilter/ipt_REJECT.c
@@ -201,7 +201,7 @@ reject_tg_check(const char *tablename, const void *e_void,
201 201
202static struct xt_target reject_tg_reg __read_mostly = { 202static struct xt_target reject_tg_reg __read_mostly = {
203 .name = "REJECT", 203 .name = "REJECT",
204 .family = AF_INET, 204 .family = NFPROTO_IPV4,
205 .target = reject_tg, 205 .target = reject_tg,
206 .targetsize = sizeof(struct ipt_reject_info), 206 .targetsize = sizeof(struct ipt_reject_info),
207 .table = "filter", 207 .table = "filter",
diff --git a/net/ipv4/netfilter/ipt_TTL.c b/net/ipv4/netfilter/ipt_TTL.c
index 30eed65e7338..7d01d424a71a 100644
--- a/net/ipv4/netfilter/ipt_TTL.c
+++ b/net/ipv4/netfilter/ipt_TTL.c
@@ -80,7 +80,7 @@ ttl_tg_check(const char *tablename, const void *e,
80 80
81static struct xt_target ttl_tg_reg __read_mostly = { 81static struct xt_target ttl_tg_reg __read_mostly = {
82 .name = "TTL", 82 .name = "TTL",
83 .family = AF_INET, 83 .family = NFPROTO_IPV4,
84 .target = ttl_tg, 84 .target = ttl_tg,
85 .targetsize = sizeof(struct ipt_TTL_info), 85 .targetsize = sizeof(struct ipt_TTL_info),
86 .table = "mangle", 86 .table = "mangle",
diff --git a/net/ipv4/netfilter/ipt_ULOG.c b/net/ipv4/netfilter/ipt_ULOG.c
index d8241e6b077b..9065e4a34fbc 100644
--- a/net/ipv4/netfilter/ipt_ULOG.c
+++ b/net/ipv4/netfilter/ipt_ULOG.c
@@ -374,7 +374,7 @@ static int ulog_tg_compat_to_user(void __user *dst, void *src)
374 374
375static struct xt_target ulog_tg_reg __read_mostly = { 375static struct xt_target ulog_tg_reg __read_mostly = {
376 .name = "ULOG", 376 .name = "ULOG",
377 .family = AF_INET, 377 .family = NFPROTO_IPV4,
378 .target = ulog_tg, 378 .target = ulog_tg,
379 .targetsize = sizeof(struct ipt_ulog_info), 379 .targetsize = sizeof(struct ipt_ulog_info),
380 .checkentry = ulog_tg_check, 380 .checkentry = ulog_tg_check,
@@ -419,7 +419,7 @@ static int __init ulog_tg_init(void)
419 return ret; 419 return ret;
420 } 420 }
421 if (nflog) 421 if (nflog)
422 nf_log_register(PF_INET, &ipt_ulog_logger); 422 nf_log_register(NFPROTO_IPV4, &ipt_ulog_logger);
423 423
424 return 0; 424 return 0;
425} 425}
diff --git a/net/ipv4/netfilter/ipt_addrtype.c b/net/ipv4/netfilter/ipt_addrtype.c
index 462a22c97877..2c9d88a6c838 100644
--- a/net/ipv4/netfilter/ipt_addrtype.c
+++ b/net/ipv4/netfilter/ipt_addrtype.c
@@ -108,14 +108,14 @@ addrtype_mt_checkentry_v1(const char *tablename, const void *ip_void,
108static struct xt_match addrtype_mt_reg[] __read_mostly = { 108static struct xt_match addrtype_mt_reg[] __read_mostly = {
109 { 109 {
110 .name = "addrtype", 110 .name = "addrtype",
111 .family = AF_INET, 111 .family = NFPROTO_IPV4,
112 .match = addrtype_mt_v0, 112 .match = addrtype_mt_v0,
113 .matchsize = sizeof(struct ipt_addrtype_info), 113 .matchsize = sizeof(struct ipt_addrtype_info),
114 .me = THIS_MODULE 114 .me = THIS_MODULE
115 }, 115 },
116 { 116 {
117 .name = "addrtype", 117 .name = "addrtype",
118 .family = AF_INET, 118 .family = NFPROTO_IPV4,
119 .revision = 1, 119 .revision = 1,
120 .match = addrtype_mt_v1, 120 .match = addrtype_mt_v1,
121 .checkentry = addrtype_mt_checkentry_v1, 121 .checkentry = addrtype_mt_checkentry_v1,
diff --git a/net/ipv4/netfilter/ipt_ah.c b/net/ipv4/netfilter/ipt_ah.c
index e977989629c7..e2e993edd665 100644
--- a/net/ipv4/netfilter/ipt_ah.c
+++ b/net/ipv4/netfilter/ipt_ah.c
@@ -83,7 +83,7 @@ ah_mt_check(const char *tablename, const void *ip_void,
83 83
84static struct xt_match ah_mt_reg __read_mostly = { 84static struct xt_match ah_mt_reg __read_mostly = {
85 .name = "ah", 85 .name = "ah",
86 .family = AF_INET, 86 .family = NFPROTO_IPV4,
87 .match = ah_mt, 87 .match = ah_mt,
88 .matchsize = sizeof(struct ipt_ah), 88 .matchsize = sizeof(struct ipt_ah),
89 .proto = IPPROTO_AH, 89 .proto = IPPROTO_AH,
diff --git a/net/ipv4/netfilter/ipt_ecn.c b/net/ipv4/netfilter/ipt_ecn.c
index 749de8284ce5..2c45b4be7c3c 100644
--- a/net/ipv4/netfilter/ipt_ecn.c
+++ b/net/ipv4/netfilter/ipt_ecn.c
@@ -114,7 +114,7 @@ ecn_mt_check(const char *tablename, const void *ip_void,
114 114
115static struct xt_match ecn_mt_reg __read_mostly = { 115static struct xt_match ecn_mt_reg __read_mostly = {
116 .name = "ecn", 116 .name = "ecn",
117 .family = AF_INET, 117 .family = NFPROTO_IPV4,
118 .match = ecn_mt, 118 .match = ecn_mt,
119 .matchsize = sizeof(struct ipt_ecn_info), 119 .matchsize = sizeof(struct ipt_ecn_info),
120 .checkentry = ecn_mt_check, 120 .checkentry = ecn_mt_check,
diff --git a/net/ipv4/netfilter/ipt_ttl.c b/net/ipv4/netfilter/ipt_ttl.c
index e0b8caeb710c..d4c3fdc2a79f 100644
--- a/net/ipv4/netfilter/ipt_ttl.c
+++ b/net/ipv4/netfilter/ipt_ttl.c
@@ -46,7 +46,7 @@ ttl_mt(const struct sk_buff *skb, const struct net_device *in,
46 46
47static struct xt_match ttl_mt_reg __read_mostly = { 47static struct xt_match ttl_mt_reg __read_mostly = {
48 .name = "ttl", 48 .name = "ttl",
49 .family = AF_INET, 49 .family = NFPROTO_IPV4,
50 .match = ttl_mt, 50 .match = ttl_mt,
51 .matchsize = sizeof(struct ipt_ttl_info), 51 .matchsize = sizeof(struct ipt_ttl_info),
52 .me = THIS_MODULE, 52 .me = THIS_MODULE,