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: Wed, 25 Mar 2009 16:17:27 +0100	[thread overview]
Message-ID: <17e3a8f80903250817i3aa80b49i9cb57d10f704e123@mail.gmail.com> (raw)
In-Reply-To: <alpine.LSU.2.00.0903251603050.18819@fbirervta.pbzchgretzou.qr>

>>>>My theory is that the original MAC-address is somehow added to the SKB
>>>>before it reaches the output-part of the RAW-table (which is where I
>>>>hook in),
>>>
>>> Routing is done before rawpost, yes, but before the (traditional) raw table.
>>> (it's in skb->dst)
>>
>>Ok, I assumed that the MAC-header was added at a lower layer, but that
>>was then wrong? For some reason I have always though skb->dst was the
>>IP-adress, I will look into that field.
>
> skb->dst contains the pointer to the neighbor (simply put), and a
> neighbor is (also simplified) what you see in `ip neigh`, i.e. MAC

Thanks.

>>After struggling a bit with the compilation (I had to remove the
>>iptable_rawpost.o ip6table_rawpost.o in Kbuild or the compiler
>>complained that it couldn't find the files), I get this error when I
>>try to use it:
>>
>>kristrev@mylatop:~/src/xtables-addons-1.12$ sudo iptables -A
>>PREROUTING -t raw -p udp -d 192.168.101.14 --dport 9999 -j RAWDNAT
>>--to-destination 192.168.100.250
>>iptables: Invalid argument
>
> See `dmesg` for the details of EINVAL.

[22480.722995] xt_RAWNAT may only be used in the "raw" or "rawpost" table.

When outputting the name of the table, I see that it is corrupted. I
tried to change the _check-function to use the new signature, but then
I got compilation-errors from the register-functions. I am using the
version of RAWNAT I found here [1] (please let me know if there is a
more recent one) and xtables-1.12.

-Kristian

  reply	other threads:[~2009-03-25 15:17 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 [this message]
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
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=17e3a8f80903250817i3aa80b49i9cb57d10f704e123@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).