Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Yun Lin <overcloud@gmail.com>
To: netfilter@vger.kernel.org
Subject: nf_conntrack entry lost after using ipq_set_verdict() with NF_ACCEPT
Date: Sun, 29 Mar 2009 18:08:45 +0200	[thread overview]
Message-ID: <49CF9D0D.6070108@gmail.com> (raw)

I am going to conntrack and NAT for a udp traffic with destination port
4.
in the conntrack helper() i did so:

if (ct->status & IPS_NAT_MASK){
    printk("going to ALG part after NAT\n");
    ret = NF_QUEUE;
    }

The first query (with dport 4) packet after MASQUERADE goes into the
application layer gateway with NF_QUEUE into userspace, where the
payload can be further changed.
Then i use ipq_set_verdict() with verdict NF_ACCEPT to forward it. But
when the response in the other direction comes, it cannot be recognized
as the reply of the query.
I think the entry of nf_conntrack of the first query packet has been
lost, because when i just use MASQUERADE without userspace processing,
the response will be marked correct as IP_CT_IS_REPLY.

I have printed out the conntrack tuple when the helper()is called,
for the Query,
ctinfo = IP_CT_NEW;
the original tuple is:
10.21.22.21:4 -> 10.23.24.24:4 l3num:2 protonum:17
the reply tuple:
10.23.24.24:4 -> 10.22.23.22:4 l3num:2 protonum:17
10.21.22.21 is the ip address of querying node, 10.22.23.22 is the NAT
and 10.23.24.24 is the responding node.

As for the Response:
ctinfo = IP_CT_NEW(which should be IP_CT_IS_REPLY)
original tuple:
10.23.24.24:4 -> 10.22.23.22:4 l3num:2 protonum:17
reply tuple:
10.22.23.22:4 -> 10.23.24.24:4 l3num:2 protonum:17

Is there someone could help me figure this out??

best regards!!

                 reply	other threads:[~2009-03-29 16:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=49CF9D0D.6070108@gmail.com \
    --to=overcloud@gmail.com \
    --cc=netfilter@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