Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 236971
b: refs/heads/master
c: 0131ba4
h: refs/heads/master
i:
  236969: a1ca713
  236967: 3510084
v: v3
  • Loading branch information
David S. Miller committed Feb 4, 2011
1 parent 220f6e3 commit 110609c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bd4a6974cc9090ef3851e5b0a2071e5383565c7c
refs/heads/master: 0131ba451e20239c5dc701027c1a2edef95e1a6e
31 changes: 17 additions & 14 deletions trunk/net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -1859,25 +1859,28 @@ static unsigned int ipv4_default_mtu(const struct dst_entry *dst)

static void rt_init_metrics(struct rtable *rt, struct fib_info *fi)
{
if (!(rt->fl.flags & FLOWI_FLAG_PRECOW_METRICS)) {
no_cow:
if (fi->fib_metrics != (u32 *) dst_default_metrics) {
rt->fi = fi;
atomic_inc(&fi->fib_clntref);
}
dst_init_metrics(&rt->dst, fi->fib_metrics, true);
} else {
struct inet_peer *peer;
struct inet_peer *peer;
int create = 0;

if (!rt->peer)
rt_bind_peer(rt, 1);
peer = rt->peer;
if (!peer)
goto no_cow;
/* If a peer entry exists for this destination, we must hook
* it up in order to get at cached metrics.
*/
if (rt->fl.flags & FLOWI_FLAG_PRECOW_METRICS)
create = 1;

rt_bind_peer(rt, create);
peer = rt->peer;
if (peer) {
if (inet_metrics_new(peer))
memcpy(peer->metrics, fi->fib_metrics,
sizeof(u32) * RTAX_MAX);
dst_init_metrics(&rt->dst, peer->metrics, false);
} else {
if (fi->fib_metrics != (u32 *) dst_default_metrics) {
rt->fi = fi;
atomic_inc(&fi->fib_clntref);
}
dst_init_metrics(&rt->dst, fi->fib_metrics, true);
}
}

Expand Down

0 comments on commit 110609c

Please sign in to comment.