From: Denis V. Lunev Date: Tue, 22 Jan 2008 01:35:06 +0000 (-0800) Subject: [NETNS]: Pass correct namespace in ip_rt_get_source. X-Git-Tag: v2.6.25-rc1~1162^2~90 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ecfdc8c5424079393a9b05e8a5aaf5c6873029f6;p=linux-2.6 [NETNS]: Pass correct namespace in ip_rt_get_source. ip_rt_get_source is the infamous place for which dst_ifdown kludges have been implemented. This means that rt->u.dst.dev can be safely dereferrenced obtain nd_net. Signed-off-by: Denis V. Lunev Signed-off-by: David S. Miller --- diff --git a/net/ipv4/route.c b/net/ipv4/route.c index f988ae39c4..27e0f81060 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -1559,7 +1559,7 @@ void ip_rt_get_source(u8 *addr, struct rtable *rt) if (rt->fl.iif == 0) src = rt->rt_src; - else if (fib_lookup(&init_net, &rt->fl, &res) == 0) { + else if (fib_lookup(rt->u.dst.dev->nd_net, &rt->fl, &res) == 0) { src = FIB_RES_PREFSRC(res); fib_res_put(&res); } else