Re: function for getting the source ip defined in the routing table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux