Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90000
b: refs/heads/master
c: 3b00944
h: refs/heads/master
v: v3
  • Loading branch information
YOSHIFUJI Hideaki committed Mar 4, 2008
1 parent b250759 commit 6a3ad06
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 21 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: 95e41e93e18d8e1e272ce23d96bae4f17ce11d42
refs/heads/master: 3b00944c5c73c49ef52bf17b66557c43c1d945fe
8 changes: 4 additions & 4 deletions trunk/include/net/ip6_route.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ extern struct rt6_info *rt6_lookup(struct in6_addr *daddr,
struct in6_addr *saddr,
int oif, int flags);

extern struct dst_entry *ndisc_dst_alloc(struct net_device *dev,
extern struct dst_entry *icmp6_dst_alloc(struct net_device *dev,
struct neighbour *neigh,
struct in6_addr *addr,
int (*output)(struct sk_buff *));
extern int ndisc_dst_gc(int *more);
struct in6_addr *addr);
extern int icmp6_dst_gc(int *more);

extern void fib6_force_start_gc(void);

extern struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev,
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv6/ip6_fib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,7 @@ void fib6_run_gc(unsigned long dummy)
}
gc_args.more = 0;

ndisc_dst_gc(&gc_args.more);
icmp6_dst_gc(&gc_args.more);
fib6_clean_all(fib6_age, 0, NULL);

if (gc_args.more)
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv6/ndisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ static void __ndisc_send(struct net_device *dev,
icmpv6_flow_init(ndisc_socket->sk, &fl, type,
saddr, daddr, dev->ifindex);

dst = ndisc_dst_alloc(dev, neigh, daddr, ip6_output);
dst = icmp6_dst_alloc(dev, neigh, daddr);
if (!dst)
return;

Expand Down
27 changes: 13 additions & 14 deletions trunk/net/ipv6/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -904,13 +904,12 @@ static inline unsigned int ipv6_advmss(unsigned int mtu)
return mtu;
}

static struct dst_entry *ndisc_dst_gc_list;
static DEFINE_SPINLOCK(ndisc_lock);
static struct dst_entry *icmp6_dst_gc_list;
static DEFINE_SPINLOCK(icmp6_dst_lock);

struct dst_entry *ndisc_dst_alloc(struct net_device *dev,
struct dst_entry *icmp6_dst_alloc(struct net_device *dev,
struct neighbour *neigh,
struct in6_addr *addr,
int (*output)(struct sk_buff *))
struct in6_addr *addr)
{
struct rt6_info *rt;
struct inet6_dev *idev = in6_dev_get(dev);
Expand All @@ -937,7 +936,7 @@ struct dst_entry *ndisc_dst_alloc(struct net_device *dev,
rt->u.dst.metrics[RTAX_HOPLIMIT-1] = 255;
rt->u.dst.metrics[RTAX_MTU-1] = ipv6_get_mtu(rt->rt6i_dev);
rt->u.dst.metrics[RTAX_ADVMSS-1] = ipv6_advmss(dst_mtu(&rt->u.dst));
rt->u.dst.output = output;
rt->u.dst.output = ip6_output;

#if 0 /* there's no chance to use these for ndisc */
rt->u.dst.flags = ipv6_addr_type(addr) & IPV6_ADDR_UNICAST
Expand All @@ -947,27 +946,27 @@ struct dst_entry *ndisc_dst_alloc(struct net_device *dev,
rt->rt6i_dst.plen = 128;
#endif

spin_lock_bh(&ndisc_lock);
rt->u.dst.next = ndisc_dst_gc_list;
ndisc_dst_gc_list = &rt->u.dst;
spin_unlock_bh(&ndisc_lock);
spin_lock_bh(&icmp6_dst_lock);
rt->u.dst.next = icmp6_dst_gc_list;
icmp6_dst_gc_list = &rt->u.dst;
spin_unlock_bh(&icmp6_dst_lock);

fib6_force_start_gc();

out:
return &rt->u.dst;
}

int ndisc_dst_gc(int *more)
int icmp6_dst_gc(int *more)
{
struct dst_entry *dst, *next, **pprev;
int freed;

next = NULL;
freed = 0;

spin_lock_bh(&ndisc_lock);
pprev = &ndisc_dst_gc_list;
spin_lock_bh(&icmp6_dst_lock);
pprev = &icmp6_dst_gc_list;

while ((dst = *pprev) != NULL) {
if (!atomic_read(&dst->__refcnt)) {
Expand All @@ -980,7 +979,7 @@ int ndisc_dst_gc(int *more)
}
}

spin_unlock_bh(&ndisc_lock);
spin_unlock_bh(&icmp6_dst_lock);

return freed;
}
Expand Down

0 comments on commit 6a3ad06

Please sign in to comment.