Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 34410
b: refs/heads/master
c: 5d0bbee
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Graf authored and David S. Miller committed Sep 22, 2006
1 parent 6028c54 commit d1cec67
Show file tree
Hide file tree
Showing 2 changed files with 12 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: 8161327311fe4da1684ed08015e141feb9a0a737
refs/heads/master: 5d0bbeeb144f631150881712607345c532e38e7e
16 changes: 11 additions & 5 deletions trunk/net/ipv6/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -747,8 +747,6 @@ static void ip6_rt_update_pmtu(struct dst_entry *dst, u32 mtu)
}
}

/* Protected by rt6_lock. */
static struct dst_entry *ndisc_dst_gc_list;
static int ipv6_get_mtu(struct net_device *dev);

static inline unsigned int ipv6_advmss(unsigned int mtu)
Expand All @@ -769,6 +767,9 @@ static inline unsigned int ipv6_advmss(unsigned int mtu)
return mtu;
}

static struct dst_entry *ndisc_dst_gc_list;
DEFINE_SPINLOCK(ndisc_lock);

struct dst_entry *ndisc_dst_alloc(struct net_device *dev,
struct neighbour *neigh,
struct in6_addr *addr,
Expand Down Expand Up @@ -809,10 +810,10 @@ struct dst_entry *ndisc_dst_alloc(struct net_device *dev,
rt->rt6i_dst.plen = 128;
#endif

write_lock_bh(&rt6_lock);
spin_lock_bh(&ndisc_lock);
rt->u.dst.next = ndisc_dst_gc_list;
ndisc_dst_gc_list = &rt->u.dst;
write_unlock_bh(&rt6_lock);
spin_unlock_bh(&ndisc_lock);

fib6_force_start_gc();

Expand All @@ -826,8 +827,11 @@ int ndisc_dst_gc(int *more)
int freed;

next = NULL;
freed = 0;

spin_lock_bh(&ndisc_lock);
pprev = &ndisc_dst_gc_list;
freed = 0;

while ((dst = *pprev) != NULL) {
if (!atomic_read(&dst->__refcnt)) {
*pprev = dst->next;
Expand All @@ -839,6 +843,8 @@ int ndisc_dst_gc(int *more)
}
}

spin_unlock_bh(&ndisc_lock);

return freed;
}

Expand Down

0 comments on commit d1cec67

Please sign in to comment.