diff options
author | David S. Miller <davem@davemloft.net> | 2011-01-28 23:01:25 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-28 23:01:25 +0100 |
commit | 9c150e82ac50a611237bbebd508d17f6347d577c (patch) | |
tree | 7c79c013857cc13570595e805de0dbdb8f00332e /net/ipv4/fib_semantics.c | |
parent | net: Pre-COW metrics for TCP. (diff) | |
download | linux-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.c | 4 |
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); |