diff options
Diffstat (limited to 'net/ipv4/route.c')
| -rw-r--r-- | net/ipv4/route.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index f1defb7d88e8..351dc4e85242 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
| @@ -2626,8 +2626,12 @@ static int ip_route_output_slow(struct net *net, struct rtable **rp, | |||
| 2626 | } | 2626 | } |
| 2627 | 2627 | ||
| 2628 | if (res.type == RTN_LOCAL) { | 2628 | if (res.type == RTN_LOCAL) { |
| 2629 | if (!fl.fl4_src) | 2629 | if (!fl.fl4_src) { |
| 2630 | fl.fl4_src = fl.fl4_dst; | 2630 | if (res.fi->fib_prefsrc) |
| 2631 | fl.fl4_src = res.fi->fib_prefsrc; | ||
| 2632 | else | ||
| 2633 | fl.fl4_src = fl.fl4_dst; | ||
| 2634 | } | ||
| 2631 | dev_out = net->loopback_dev; | 2635 | dev_out = net->loopback_dev; |
| 2632 | fl.oif = dev_out->ifindex; | 2636 | fl.oif = dev_out->ifindex; |
| 2633 | res.fi = NULL; | 2637 | res.fi = NULL; |
