aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-03-05 00:26:07 -0500
committerDavid S. Miller <davem@davemloft.net>2011-03-05 00:26:07 -0500
commit3c0afdca44af795dd315c20cc525927a459abe30 (patch)
tree264a6e889d080da61a754b54e2771282c9fe9248 /net
parent44713b67db10c774f14280c129b0d5fd13c70cf2 (diff)
ipv4: Get peer more cheaply in rt_init_metrics().
We know this is a new route object, so doing atomics and stuff makes no sense at all. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/route.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 6c8740362ef9..9794a2c60238 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1759,9 +1759,9 @@ static void rt_init_metrics(struct rtable *rt, struct fib_info *fi)
1759 if (rt->fl.flags & FLOWI_FLAG_PRECOW_METRICS) 1759 if (rt->fl.flags & FLOWI_FLAG_PRECOW_METRICS)
1760 create = 1; 1760 create = 1;
1761 1761
1762 rt_bind_peer(rt, create); 1762 rt->peer = peer = inet_getpeer_v4(rt->rt_dst, create);
1763 peer = rt->peer;
1764 if (peer) { 1763 if (peer) {
1764 rt->rt_peer_genid = rt_peer_genid();
1765 if (inet_metrics_new(peer)) 1765 if (inet_metrics_new(peer))
1766 memcpy(peer->metrics, fi->fib_metrics, 1766 memcpy(peer->metrics, fi->fib_metrics,
1767 sizeof(u32) * RTAX_MAX); 1767 sizeof(u32) * RTAX_MAX);