From: Andreas Herz <andi@geekosphere.org>
To: Jan Engelhardt <jengelh@inai.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: function for getting the source ip defined in the routing table
Date: Tue, 20 May 2014 16:18:28 +0200 [thread overview]
Message-ID: <20140520141828.GO10939@kvmbude> (raw)
In-Reply-To: <alpine.LSU.2.11.1405201602100.9387@nerf08.vanv.qr>
Hi Jan,
On 20/05/14 at 16:03, Jan Engelhardt wrote:
> On Tuesday 2014-05-20 14:46, Andreas Herz wrote:
> >i was looking for a function to get the source ip that is defined in the
> >routing table. I looked into the MASQUERADE module but the
> >"inet_select_addr" function returns the source ip from the interface
> >(the first one, in most use cases).
>
> RTM_GETROUTE in netlink, `ip route get` on sh, and
> ip6_route_output/ip_route_output_key in C.
Thanks for the hint to RTM_GETROUTE, but i'm wondering how i can receive
the src from ip_route_ouput_key, since with this commit the rt_src got
removed:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/net/ipv4/route.c?id=d6c0a4f609847d6e65658913f9ccbcb1c137cff3
Or did i miss the new variable for the src or misunderstand the change?
thanks so far!
--
Andreas Herz
next prev parent reply other threads:[~2014-05-20 14:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-20 12:46 function for getting the source ip defined in the routing table Andreas Herz
2014-05-20 14:03 ` Jan Engelhardt
2014-05-20 14:18 ` Andreas Herz [this message]
2014-05-20 15:38 ` Maciej Żenczykowski
2014-05-21 8:36 ` Andreas Herz
2014-05-21 17:06 ` Maciej Żenczykowski
2014-05-21 17:07 ` Maciej Żenczykowski
2014-05-22 9:11 ` Andreas Herz
[not found] ` <CAJ26g5T1Ugfy-tfeFUBWABLrwuNkG26V7u=SvF6cr9pFwkGobA@mail.gmail.com>
2014-05-22 10:31 ` Andreas Herz
2014-06-03 7:55 ` Andreas Herz
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=20140520141828.GO10939@kvmbude \
--to=andi@geekosphere.org \
--cc=jengelh@inai.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).