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 11:26:47 +0100	[thread overview]
Message-ID: <17e3a8f80903260326i636c7c0byaf4d9b0b8e77c514@mail.gmail.com> (raw)
In-Reply-To: <49CA9B8B.7080605@gmail.com>

>>>>> However, I have noticed a similar problem when using my module on
>>>>> incoming
>>>>> packets in PREROUTING (on the multihomed receiver), the IP adress is
>>>>> changed
>>>>> (accoring to my dmesg-output) but then they are not heard from again.
>>>>>
>>>>
>>>> Probably dropped due to L3 or L4 checksum mismatches. While we try to
>>>> change the checksum, I have not verified it for all cases.
>>>>
>>>>
>>>
>>> Hm, I am noe sure. I recalculate the checksum (using csum_replace4 for l3
>>> and
>>> inet....replace4 for l4) after modifying the destination IP, and when
>>> used with
>>> OUTPUT the checksum is correct. Since tcpdump/Wireshark outputs the
>>> packets
>>> before they are modified I haven't been able to verify this though.
>>>

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.

-Kristian

  reply	other threads:[~2009-03-26 10:26 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 [this message]
2009-03-26 20:07                   ` Jan Engelhardt
2009-03-26 20:54                     ` Kristian Evensen
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=17e3a8f80903260326i636c7c0byaf4d9b0b8e77c514@mail.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).