From ce239dea5cf8fd3b373fa6df60453641d12b7f6a Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Mon, 2 May 2011 14:37:45 -0700 Subject: [PATCH] --- yaml --- r: 247043 b: refs/heads/master c: 5615787257742aab42ecf17c11e3244d9536a48d h: refs/heads/master i: 247041: a3b23a5d835afb849b8f3dd5ec0eccd09fe285ae 247039: 26842f26244e9660586b2337616aabfa1c4be766 v: v3 --- [refs] | 2 +- trunk/net/ipv4/route.c | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 7d447a8b02eb..ce73e6e597ca 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 14ad2513ed5b709e566a853f4b515d91c5d83311 +refs/heads/master: 5615787257742aab42ecf17c11e3244d9536a48d diff --git a/trunk/net/ipv4/route.c b/trunk/net/ipv4/route.c index 93f71be1d5d1..64f360d853fb 100644 --- a/trunk/net/ipv4/route.c +++ b/trunk/net/ipv4/route.c @@ -2675,6 +2675,10 @@ struct rtable *__ip_route_output_key(struct net *net, struct flowi4 *flp4) dst_use(&rth->dst, jiffies); RT_CACHE_STAT_INC(out_hit); rcu_read_unlock_bh(); + if (!flp4->saddr) + flp4->saddr = rth->rt_src; + if (!flp4->daddr) + flp4->daddr = rth->rt_dst; return rth; } RT_CACHE_STAT_INC(out_hlist_search); @@ -2772,15 +2776,10 @@ struct rtable *ip_route_output_flow(struct net *net, struct flowi4 *flp4, if (IS_ERR(rt)) return rt; - if (flp4->flowi4_proto) { - if (!flp4->saddr) - flp4->saddr = rt->rt_src; - if (!flp4->daddr) - flp4->daddr = rt->rt_dst; + if (flp4->flowi4_proto) rt = (struct rtable *) xfrm_lookup(net, &rt->dst, flowi4_to_flowi(flp4), sk, 0); - } return rt; }