Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 254671
b: refs/heads/master
c: 957c665
h: refs/heads/master
i:
  254669: 0cd8491
  254667: c55e391
  254663: 191a4c6
  254655: 1acddd8
v: v3
  • Loading branch information
David S. Miller committed Jul 2, 2011
1 parent 82de971 commit 0a1abd7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 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: 11d53b4990226247a950e2b1ccfa4cf93bfbc822
refs/heads/master: 957c665f37007de93ccbe45902a23143724170d0
1 change: 1 addition & 0 deletions trunk/include/net/dst.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ struct dst_entry {
#define DST_NOPOLICY 0x0004
#define DST_NOHASH 0x0008
#define DST_NOCACHE 0x0010
#define DST_NOCOUNT 0x0020
union {
struct dst_entry *next;
struct rtable __rcu *rt_next;
Expand Down
6 changes: 4 additions & 2 deletions trunk/net/core/dst.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ void *dst_alloc(struct dst_ops *ops, struct net_device *dev,
dst->lastuse = jiffies;
dst->flags = flags;
dst->next = NULL;
dst_entries_add(ops, 1);
if (!(flags & DST_NOCOUNT))
dst_entries_add(ops, 1);
return dst;
}
EXPORT_SYMBOL(dst_alloc);
Expand Down Expand Up @@ -243,7 +244,8 @@ struct dst_entry *dst_destroy(struct dst_entry * dst)
neigh_release(neigh);
}

dst_entries_add(dst->ops, -1);
if (!(dst->flags & DST_NOCOUNT))
dst_entries_add(dst->ops, -1);

if (dst->ops->destroy)
dst->ops->destroy(dst);
Expand Down
13 changes: 7 additions & 6 deletions trunk/net/ipv6/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,10 @@ static struct rt6_info ip6_blk_hole_entry_template = {

/* allocate dst with ip6_dst_ops */
static inline struct rt6_info *ip6_dst_alloc(struct dst_ops *ops,
struct net_device *dev)
struct net_device *dev,
int flags)
{
struct rt6_info *rt = dst_alloc(ops, dev, 0, 0, 0);
struct rt6_info *rt = dst_alloc(ops, dev, 0, 0, flags);

memset(&rt->rt6i_table, 0, sizeof(*rt) - sizeof(struct dst_entry));

Expand Down Expand Up @@ -1042,7 +1043,7 @@ struct dst_entry *icmp6_dst_alloc(struct net_device *dev,
if (unlikely(idev == NULL))
return NULL;

rt = ip6_dst_alloc(&net->ipv6.ip6_dst_ops, dev);
rt = ip6_dst_alloc(&net->ipv6.ip6_dst_ops, dev, 0);
if (unlikely(rt == NULL)) {
in6_dev_put(idev);
goto out;
Expand Down Expand Up @@ -1206,7 +1207,7 @@ int ip6_route_add(struct fib6_config *cfg)
goto out;
}

rt = ip6_dst_alloc(&net->ipv6.ip6_dst_ops, NULL);
rt = ip6_dst_alloc(&net->ipv6.ip6_dst_ops, NULL, DST_NOCOUNT);

if (rt == NULL) {
err = -ENOMEM;
Expand Down Expand Up @@ -1726,7 +1727,7 @@ static struct rt6_info * ip6_rt_copy(struct rt6_info *ort)
{
struct net *net = dev_net(ort->rt6i_dev);
struct rt6_info *rt = ip6_dst_alloc(&net->ipv6.ip6_dst_ops,
ort->dst.dev);
ort->dst.dev, 0);

if (rt) {
rt->dst.input = ort->dst.input;
Expand Down Expand Up @@ -2005,7 +2006,7 @@ struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev,
{
struct net *net = dev_net(idev->dev);
struct rt6_info *rt = ip6_dst_alloc(&net->ipv6.ip6_dst_ops,
net->loopback_dev);
net->loopback_dev, 0);
struct neighbour *neigh;

if (rt == NULL) {
Expand Down

0 comments on commit 0a1abd7

Please sign in to comment.