Linux Netfilter development
 help / color / mirror / Atom feed
* [PATCH] netfilter: fix arptable_filter wrong hook registering
@ 2008-10-16  1:24 Pablo Neira Ayuso
  2008-10-16  1:41 ` Jan Engelhardt
  0 siblings, 1 reply; 15+ messages in thread
From: Pablo Neira Ayuso @ 2008-10-16  1:24 UTC (permalink / raw)
  To: netfilter-devel; +Cc: kaber

This patch replaces NFPROTO_ARP by NF_ARP in the hooks registered
by arptable_filter, otherwise the arptables tool does not work.
Thus, we use NF_ARP to register ARP hooks to match the NF_HOOK
invocation in net/ipv4/arp.c and NFPROTO_ARP for internal xtables
handling, ie. matches, targets and tables.

This patch also fixes the ARP mangling in the ipt_CLUSTERIP target.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---

 net/ipv4/netfilter/arptable_filter.c |    6 +++---
 net/ipv4/netfilter/ipt_CLUSTERIP.c   |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/netfilter/arptable_filter.c b/net/ipv4/netfilter/arptable_filter.c
index bee3d11..984d05d 100644
--- a/net/ipv4/netfilter/arptable_filter.c
+++ b/net/ipv4/netfilter/arptable_filter.c
@@ -89,21 +89,21 @@ static struct nf_hook_ops arpt_ops[] __read_mostly = {
 	{
 		.hook		= arpt_in_hook,
 		.owner		= THIS_MODULE,
-		.pf		= NFPROTO_ARP,
+		.pf		= NF_ARP,
 		.hooknum	= NF_ARP_IN,
 		.priority	= NF_IP_PRI_FILTER,
 	},
 	{
 		.hook		= arpt_out_hook,
 		.owner		= THIS_MODULE,
-		.pf		= NFPROTO_ARP,
+		.pf		= NF_ARP,
 		.hooknum	= NF_ARP_OUT,
 		.priority	= NF_IP_PRI_FILTER,
 	},
 	{
 		.hook		= arpt_forward_hook,
 		.owner		= THIS_MODULE,
-		.pf		= NFPROTO_ARP,
+		.pf		= NF_ARP,
 		.hooknum	= NF_ARP_FORWARD,
 		.priority	= NF_IP_PRI_FILTER,
 	},
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c
index 7ac1677..af8b1bb 100644
--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
+++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
@@ -541,7 +541,7 @@ arp_mangle(unsigned int hook,
 
 static struct nf_hook_ops cip_arp_ops __read_mostly = {
 	.hook = arp_mangle,
-	.pf = NFPROTO_ARP,
+	.pf = NF_ARP,
 	.hooknum = NF_ARP_OUT,
 	.priority = -1
 };


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2008-10-20  9:54 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-16  1:24 [PATCH] netfilter: fix arptable_filter wrong hook registering Pablo Neira Ayuso
2008-10-16  1:41 ` Jan Engelhardt
2008-10-16  1:54   ` Pablo Neira Ayuso
2008-10-16  2:03     ` Jan Engelhardt
2008-10-16 11:52       ` Pablo Neira Ayuso
2008-10-16 11:52       ` Patrick McHardy
2008-10-16 11:56         ` Pablo Neira Ayuso
2008-10-16 11:58           ` Patrick McHardy
2008-10-17 14:20           ` Jan Engelhardt
2008-10-17 14:44             ` netfilter: use NFPROTO_* constants in NF_HOOK callsites Jan Engelhardt
2008-10-18 16:13               ` Patrick McHardy
2008-10-18 19:21                 ` Jan Engelhardt
2008-10-19 12:46                   ` Pablo Neira Ayuso
2008-10-17 14:44             ` netfilter: use NFPROTO_* constants in nf_hook_ops structures Jan Engelhardt
2008-10-20  9:54   ` [PATCH] netfilter: fix arptable_filter wrong hook registering Patrick McHardy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox