Linux Netfilter development
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: netfilter-devel@vger.kernel.org, kaber@trash.net
Subject: Re: [PATCH] netfilter: fix arptable_filter wrong hook registering
Date: Thu, 16 Oct 2008 03:54:58 +0200	[thread overview]
Message-ID: <48F69EF2.5000104@netfilter.org> (raw)
In-Reply-To: <alpine.LNX.1.10.0810152126380.28060@fbirervta.pbzchgretzou.qr>

Jan Engelhardt wrote:
> On Wednesday 2008-10-15 21:24, Pablo Neira Ayuso wrote:
> 
>> 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 does not fly. You are essentially trying to register
> arpt_in_hook for NFPROTO_UNSPEC, since NF_ARP == 0, and
> 0 == NFPROTO_UNSPEC.

This flies like a Boeing(R) 777 buddy ;). As the NFPROTO_* thing is only
internal used by xtables, not by the hooks. The hooks use the protocol
family, and we've been using NF_ARP to 0 by now.

> Define "does not work". Do you mean arptables sees no packets?

arptables sees *no packet at all*.

The ARP mangling does not work. Try:

arptables -o eth0 -l 6 -I OUTPUT -j mangle --mangle-mac-s 00:15:58:28:5a:30

and tcpdump the arp request.

> Perhaps the following helps?

Yes, your patch will also work, but it introduces an inconsistency in
the naming used to register hooks in the family field.

-- 
"Los honestos son inadaptados sociales" -- Les Luthiers

  reply	other threads:[~2008-10-16  1:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48F69EF2.5000104@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=jengelh@medozas.de \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox