From: Kouya Shimura Date: Tue, 10 Nov 2015 17:15:26 +0900 Subject: [PATCH net] ipv4: re-create rt_dst when rt_iif doesn't match orig_oif Otherwise packets sometimes unreach when the socket is bind to a device. Signed-off-by: Kouya Shimura --- net/ipv4/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 85f184e..546cabe 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -2027,7 +2027,7 @@ static struct rtable *__mkroute_output(const struct fib_result *res, prth = raw_cpu_ptr(nh->nh_pcpu_rth_output); } rth = rcu_dereference(*prth); - if (rt_cache_valid(rth)) { + if (rt_cache_valid(rth) && rth->rt_iif == orig_oif) { dst_hold(&rth->dst); return rth; } -- 1.9.1