aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_frontend.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/fib_frontend.c')
-rw-r--r--net/ipv4/fib_frontend.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index e056154076b3..6761639dd0e9 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -228,6 +228,7 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
228 struct fib_result res; 228 struct fib_result res;
229 int no_addr, rpf; 229 int no_addr, rpf;
230 int ret; 230 int ret;
231 struct net *net;
231 232
232 no_addr = rpf = 0; 233 no_addr = rpf = 0;
233 rcu_read_lock(); 234 rcu_read_lock();
@@ -241,7 +242,8 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
241 if (in_dev == NULL) 242 if (in_dev == NULL)
242 goto e_inval; 243 goto e_inval;
243 244
244 if (fib_lookup(&init_net, &fl, &res)) 245 net = dev->nd_net;
246 if (fib_lookup(net, &fl, &res))
245 goto last_resort; 247 goto last_resort;
246 if (res.type != RTN_UNICAST) 248 if (res.type != RTN_UNICAST)
247 goto e_inval_res; 249 goto e_inval_res;
@@ -265,7 +267,7 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
265 fl.oif = dev->ifindex; 267 fl.oif = dev->ifindex;
266 268
267 ret = 0; 269 ret = 0;
268 if (fib_lookup(&init_net, &fl, &res) == 0) { 270 if (fib_lookup(net, &fl, &res) == 0) {
269 if (res.type == RTN_UNICAST) { 271 if (res.type == RTN_UNICAST) {
270 *spec_dst = FIB_RES_PREFSRC(res); 272 *spec_dst = FIB_RES_PREFSRC(res);
271 ret = FIB_RES_NH(res).nh_scope >= RT_SCOPE_HOST; 273 ret = FIB_RES_NH(res).nh_scope >= RT_SCOPE_HOST;