From: Changli Gao <xiaosuo@gmail.com>
To: Patrick McHardy <kaber@trash.net>
Cc: "David S. Miller" <davem@davemloft.net>,
netfilter-devel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] netfilter: place in source hash after SNAT is done
Date: Mon, 15 Nov 2010 19:16:46 +0800 [thread overview]
Message-ID: <AANLkTi=ymap8-3ZJQ6OOSKNeQ9jrbUr7SwFNH9L3Nv7T@mail.gmail.com> (raw)
In-Reply-To: <4CE11475.30905@trash.net>
On Mon, Nov 15, 2010 at 7:07 PM, Patrick McHardy <kaber@trash.net> wrote:
> On 15.11.2010 05:48, Changli Gao wrote:
>> If SNAT isn't done, the wrong info maybe got by the other cts.
>>
>> As the filter table is after DNAT table, the packets dropped in filter
>> table also bother bysource hash table.
>>
>> Signed-off-by: Changli Gao <xiaosuo@gmail.com>
>> ---
>> net/ipv4/netfilter/nf_nat_core.c | 18 +++++++++++-------
>> 1 file changed, 11 insertions(+), 7 deletions(-)
>> diff --git a/net/ipv4/netfilter/nf_nat_core.c b/net/ipv4/netfilter/nf_nat_core.c
>> index c04787c..51ce55a 100644
>> --- a/net/ipv4/netfilter/nf_nat_core.c
>> +++ b/net/ipv4/netfilter/nf_nat_core.c
>> @@ -545,11 +550,10 @@ static void nf_nat_move_storage(void *new, void *old)
>> struct nf_conn_nat *old_nat = old;
>> struct nf_conn *ct = old_nat->ct;
>>
>> - if (!ct || !(ct->status & IPS_NAT_DONE_MASK))
>> + if (!ct || !(ct->status & IPS_SRC_NAT_DONE))
>> return;
>>
>> spin_lock_bh(&nf_nat_lock);
>> - new_nat->ct = ct;
>
> Why are you removing this?
>
nf_ct_ext uses __krealloc() to enlarge memory, so the content has been
copied already.
--
Regards,
Changli Gao(xiaosuo@gmail.com)
prev parent reply other threads:[~2010-11-15 11:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-15 4:48 [PATCH] netfilter: place in source hash after SNAT is done Changli Gao
2010-11-15 11:07 ` Patrick McHardy
2010-11-15 11:16 ` Changli Gao [this message]
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='AANLkTi=ymap8-3ZJQ6OOSKNeQ9jrbUr7SwFNH9L3Nv7T@mail.gmail.com' \
--to=xiaosuo@gmail.com \
--cc=davem@davemloft.net \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).