Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Yun Lin <overcloud@gmail.com>
To: netfilter@vger.kernel.org
Subject: HELP!! responded Tuple doesn't match after MASQUERADE, and marked as IP_CT_NEW,therefor no DNAT will be applied
Date: Sat, 21 Mar 2009 14:54:58 +0100	[thread overview]
Message-ID: <49C4F1B2.9070306@gmail.com> (raw)

I am going to conntrack and NAT for a udp traffic with destination port
4. So I just changed very a little lines of helper structer in the
nf_conntrack_ftp.c :
ftp[i][j].tuple.src.u.udp.port = 4;
ftp[i][j].tuple.dst.protonum = IPPROTP_UDP;

and right after it enters the conntrack_helper i printed out the tuple
content of the skbuff.
It looks like this:
for the initiatted Query,
ctinfo = IP_CT_NEW;
the original tuple is:
0x0a151615:4 -> 0x0a161717:4 l3num:2 protonum:17
the reply tuple:
0x0a161717:4 -> 0x0a161716:4 l3num:2 protonum:17(here the ipt_MASQUERADE
has altered the reply tuple after SNAT).

and when the Response comes, the output is then:
ctinfo = IP_CT_NEW(which i think should be IP_CT_IS_REPLY)
original tuple:
0x0a161717:4 -> 0x0a161716:4 l3num:2 protonum:17
reply tuple:
0x0a161716:4 -> 0x0a161717:4 l3num:2 protonum:17

I think the promblem here is that when the Response get into
"resolve_normal_ct()", it couldn't find the right tuple it belongs to,
so the netfilter initiated a new tuple for it as what i'v printed out.
But the original tuple of Response matched exactly the reply tuple of
Query. It should find the right tuple when it get into PREROUTING hooks,
but not initiated a new tuple of it..

Is there someone could help me figure this out??

best regards!!


-- 
Yun Lin
76137 Karlsruhe
Baden-W¨¹rttemberg
overcloud@gmail.com


                 reply	other threads:[~2009-03-21 13:54 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=49C4F1B2.9070306@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