lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20141017100801.f1c310de.skraw@ithnet.com>
Date:	Fri, 17 Oct 2014 10:08:01 +0200
From:	Stephan von Krawczynski <skraw@...net.com>
To:	linux-kernel@...r.kernel.org
Subject: How to find the correct source address to a destination in a kernel
 driver?

Hello all,

in former kernels with routing cache things were easy. We just used :

        rt = ip_route_output_key(XXX)
        src = rt->rt_src;

Now if there is no routing cache, we tried this:

        rt = ip_route_output_key(XXX)
        src = inet_select_addr(rt->dst.dev, dst, RT_SCOPE_UNIVERSE);

Unfortunately this does not work with interfaces having multiple ip addresses
and the routing in question is not over the first configured ip.
How do I get the correct src for all possible cases?

-- 
Regards,
Stephan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ