From: Nir Tzachar <nir.tzachar@gmail.com>
To: Philip Craig <philipc@snapgear.com>
Cc: netfilter-devel@vger.kernel.org, jengelh@medozas.de
Subject: Re: [PATCH]: Fix ipt_REJECT problem with nf_bridge
Date: Wed, 11 Mar 2009 13:44:02 +0200 [thread overview]
Message-ID: <9b2db90b0903110444w47a99705qe0f22c21cdd0263d@mail.gmail.com> (raw)
In-Reply-To: <9b2db90b0903110229k14d0622flb7c4bfeecb02ca1a@mail.gmail.com>
Hi.
On Wed, Mar 11, 2009 at 11:29 AM, Nir Tzachar <nir.tzachar@gmail.com> wrote:
> Hello.
>
> Thanks for your reply.
>
> On Tue, Mar 10, 2009 at 7:43 AM, Philip Craig <philipc@snapgear.com> wrote:
>> Nir Tzachar wrote:
>>>> The problem arises from the following code
>>>> (net/ipv4/netfilter/ipt_REJECT.c line 221:)
>>>>
>>>> if (hook != NF_INET_FORWARD
>>>> #ifdef CONFIG_BRIDGE_NETFILTER
>>>> || (nskb->nf_bridge && nskb->nf_bridge->mask & BRNF_BRIDGED)
>>>> #endif
>>>> )
>>>> addr_type = RTN_LOCAL;
>>>>
>>>> but, as nskb was newly allocated just a few line back, the
>>>> oldskb->nf_bridge was never copied, so nskb->nf_bridge is always NULL.
>>
>> Is there a reason you need to copy it into nskb, rather
>> than just changing the test to check oldskb?
>>
>> I don't think ipv4 netfilter should be setting this field
>> for new packets. The bridging code will do that if needed
>> when it receives the packet.
>
> I agree. However, when I tried it (before setting the bridge argument
> on the new skb), the kernel crashes. I do not exactly remember where,
> but I think route_me_harder tries to dereference the nf_bridge
> pointer. I may be entirely wrong, so I'll give it another check.
I have checked the change you proposed (checking oldskb instead of
nskb) , and indeed it works. Should I resubmit a patch for it?
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2009-03-11 11:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-26 8:48 [PATCH]: Fix ipt_REJECT problem with nf_bridge Nir Tzachar
2009-03-10 5:29 ` Nir Tzachar
2009-03-10 5:43 ` Philip Craig
2009-03-11 9:29 ` Nir Tzachar
2009-03-11 11:44 ` Nir Tzachar [this message]
2009-03-12 1:04 ` Philip Craig
2009-03-12 3:25 ` Jan Engelhardt
2009-03-12 6:04 ` Philip Craig
2009-03-12 10:35 ` Jan Engelhardt
[not found] ` <9b2db90b0903120516n1f9e67ck8994c9b92bb6aa0a@mail.gmail.com>
2009-03-12 12:17 ` Nir Tzachar
2009-03-13 0:50 ` Philip Craig
2009-03-16 15:11 ` 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=9b2db90b0903110444w47a99705qe0f22c21cdd0263d@mail.gmail.com \
--to=nir.tzachar@gmail.com \
--cc=jengelh@medozas.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=philipc@snapgear.com \
/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;
as well as URLs for NNTP newsgroup(s).