Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 236799
b: refs/heads/master
c: 725d1e1
h: refs/heads/master
i:
  236797: 4e8e676
  236795: 1138a5b
  236791: 2dfd66b
  236783: cd014c8
  236767: d89b233
  236735: e16fb19
  236671: 5655514
  236543: a1a39cb
v: v3
  • Loading branch information
David S. Miller committed Jan 28, 2011
1 parent 7ef5644 commit 21adee5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 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: 9c150e82ac50a611237bbebd508d17f6347d577c
refs/heads/master: 725d1e1b457dc2bbebb337677e73efe7c6d14da5
1 change: 1 addition & 0 deletions trunk/include/net/dst.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ struct dst_entry {
#ifdef __KERNEL__

extern u32 *dst_cow_metrics_generic(struct dst_entry *dst, unsigned long old);
extern const u32 dst_default_metrics[RTAX_MAX];

#define DST_METRICS_READ_ONLY 0x1UL
#define __DST_METRICS_PTR(Y) \
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/core/dst.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ int dst_discard(struct sk_buff *skb)
}
EXPORT_SYMBOL(dst_discard);

static const u32 dst_default_metrics[RTAX_MAX];
const u32 dst_default_metrics[RTAX_MAX];

void *dst_alloc(struct dst_ops *ops)
{
Expand Down
12 changes: 8 additions & 4 deletions trunk/net/ipv4/fib_semantics.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ 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);
if (fi->fib_metrics != (u32 *) dst_default_metrics)
kfree(fi->fib_metrics);
kfree(fi);
}

Expand Down Expand Up @@ -743,9 +744,12 @@ 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;
if (cfg->fc_mx) {
fi->fib_metrics = kzalloc(sizeof(u32) * RTAX_MAX, GFP_KERNEL);
if (!fi->fib_metrics)
goto failure;
} else
fi->fib_metrics = (u32 *) dst_default_metrics;
fib_info_cnt++;

fi->fib_net = hold_net(net);
Expand Down

0 comments on commit 21adee5

Please sign in to comment.