summaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_semantics.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-01-28 23:01:25 +0100
committerDavid S. Miller <davem@davemloft.net>2011-01-28 23:01:25 +0100
commit9c150e82ac50a611237bbebd508d17f6347d577c (patch)
tree7c79c013857cc13570595e805de0dbdb8f00332e /net/ipv4/fib_semantics.c
parentnet: Pre-COW metrics for TCP. (diff)
downloadlinux-9c150e82ac50a611237bbebd508d17f6347d577c.tar.xz
linux-9c150e82ac50a611237bbebd508d17f6347d577c.zip
ipv4: Allocate fib metrics dynamically.
This is the initial gateway towards super-sharing metrics if they are all set to zero for a route. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/fib_semantics.c')
-rw-r--r--net/ipv4/fib_semantics.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 9aff11d7278f..363ec39228d3 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -152,6 +152,7 @@ static void free_fib_info_rcu(struct rcu_head *head)
{
struct fib_info *fi = container_of(head, struct fib_info, rcu);
+ kfree(fi->fib_metrics);
kfree(fi);
}
@@ -742,6 +743,9 @@ struct fib_info *fib_create_info(struct fib_config *cfg)
fi = kzalloc(sizeof(*fi)+nhs*sizeof(struct fib_nh), GFP_KERNEL);
if (fi == NULL)
goto failure;
+ fi->fib_metrics = kzalloc(sizeof(u32) * RTAX_MAX, GFP_KERNEL);
+ if (!fi->fib_metrics)
+ goto failure;
fib_info_cnt++;
fi->fib_net = hold_net(net);