All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Glenn.Swonk@tais.com
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: Question about IP rerouting at POST_ROUTE_HOOK
Date: Mon, 01 Mar 2004 16:25:51 +0100	[thread overview]
Message-ID: <404355FF.5010305@trash.net> (raw)
In-Reply-To: <OFAFE494A0.B2169671-ON88256E4A.000CABC4@tais.net>

Glenn.Swonk@tais.com wrote:
> I have written a netfilter module that loads as a kernel loadable module.
> 
> I am hooking into the NF_IP_POST_ROUTING hook.
> 
> I am trying to change the destination (IP address) of the packet at this
> point and am having a problem.
> 
> I am able to change the dest IP address but it is sent out with the
> original IP destination's  MAC address.
> 
> I cannot seem to change the destination MAC address at this point.

You need to make a new route lookup with the changed IP.
The easiest way of doing so is using ip_route_me_harder, it also
does all the work like relocating the packet if the headroom is
too small for the new output device etc.

Regards
Patrick

> 
> Is there a problem with changing the IP address (by manipulation of the
> skbuf data structure) or
> is a better method.
> 
> Any suggestions?
> 
> thanks,
> glenn
> 
> 
> 
> 
> 
> 
> 
> Glenn Swonk
> Toshiba America Information System
> 9740 Irvine Blvd.
> Irvine, CA 92618
> 
> 949-587-6530
> gswonk at tais.com
> 
> Not Done = Less than 100%
> Testing is never finished, only abandoned...
> 
> 

  reply	other threads:[~2004-03-01 15:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-01  2:21 Question about IP rerouting at POST_ROUTE_HOOK Glenn.Swonk
2004-03-01 15:25 ` Patrick McHardy [this message]
2004-03-01 21:00   ` Updating a modular ip_queue Scott MacKay
2004-03-01 23:29     ` Henrik Nordstrom
2004-03-01 16:33 ` Question about IP rerouting at POST_ROUTE_HOOK Henrik Nordstrom

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=404355FF.5010305@trash.net \
    --to=kaber@trash.net \
    --cc=Glenn.Swonk@tais.com \
    --cc=netfilter-devel@lists.netfilter.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.