netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kristian Evensen <kristian.evensen@gmail.com>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: Wrong MAC in redirected packet
Date: Thu, 26 Mar 2009 21:54:54 +0100	[thread overview]
Message-ID: <49CBEB9E.7080902@gmail.com> (raw)
In-Reply-To: <alpine.LSU.2.00.0903262106140.15111@fbirervta.pbzchgretzou.qr>

Jan Engelhardt skrev:
> On Thursday 2009-03-26 11:26, Kristian Evensen wrote:
>   
>> Turned out that it was the checksums. They were calculated correctly,
>> but since I processed packets on input, tcp_hdr and udp_hdr of course
>> returned invalid pointers. My code is now more or less RAWNAT, so if
>> it is of interest to anybody else I will merge them and make it
>> available.
>>     
>
> I have now rebased the RAWNAT branch to Xt-a's master and
> made the rawpost tables workable with all kernel versions.
> It does not have MAC addr punning yet.
>   
Great, but I think I see a small bug (I left my Linux-machine at work so 
I am not able to try it out). If you use RAWDNAT in prerouting, tcp_hdr 
and udp_hdr will return the wrong values since the corresponsing values 
in the SKB are not set yet. At least, that is what I experienced in my 
own module. Please let me know if I am wrong :)

Would a better solution by to use conntrack to determine the direction, 
check the name of the chain (is that possible?) or just simply ip_hdr + 
1? :)

-Kristian

  reply	other threads:[~2009-03-26 20:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-25 14:27 Wrong MAC in redirected packet Kristian Evensen
2009-03-25 14:33 ` Jan Engelhardt
2009-03-25 15:00   ` Kristian Evensen
2009-03-25 15:04     ` Jan Engelhardt
2009-03-25 15:17       ` Kristian Evensen
2009-03-25 15:20         ` Jan Engelhardt
2009-03-25 19:47       ` Kristian Evensen
2009-03-25 19:48         ` Jan Engelhardt
2009-03-25 19:56           ` Kristian Evensen
2009-03-25 19:57             ` Jan Engelhardt
2009-03-25 21:00               ` Kristian Evensen
2009-03-26 10:26                 ` Kristian Evensen
2009-03-26 20:07                   ` Jan Engelhardt
2009-03-26 20:54                     ` Kristian Evensen [this message]
2009-04-26  9:46                       ` Jan Engelhardt
2009-04-26 16:22                         ` Kristian Evensen
2009-04-26 21:29                           ` Jan Engelhardt

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=49CBEB9E.7080902@gmail.com \
    --to=kristian.evensen@gmail.com \
    --cc=jengelh@medozas.de \
    --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).