aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/route.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r--net/ipv4/route.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index df948b0f1ac9..93bfd95584f4 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2649,8 +2649,12 @@ static int ip_route_output_slow(struct net *net, struct rtable **rp,
2649 } 2649 }
2650 2650
2651 if (res.type == RTN_LOCAL) { 2651 if (res.type == RTN_LOCAL) {
2652 if (!fl.fl4_src) 2652 if (!fl.fl4_src) {
2653 fl.fl4_src = fl.fl4_dst; 2653 if (res.fi->fib_prefsrc)
2654 fl.fl4_src = res.fi->fib_prefsrc;
2655 else
2656 fl.fl4_src = fl.fl4_dst;
2657 }
2654 dev_out = net->loopback_dev; 2658 dev_out = net->loopback_dev;
2655 fl.oif = dev_out->ifindex; 2659 fl.oif = dev_out->ifindex;
2656 res.fi = NULL; 2660 res.fi = NULL;