Commit 2546ee7a authored by Hideaki Yoshifuji's avatar Hideaki Yoshifuji Committed by David S. Miller

[IPV6]: Do not export rt6_dflt_{pointer,lock}.

Modify them using exported procedural interfaces instead.
Signed-off-by: default avatarHideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Signed-off-by; David S. Miller <davem@davemloft.net>
parent 524146a6
...@@ -89,6 +89,8 @@ extern struct rt6_info * rt6_add_dflt_router(struct in6_addr *gwaddr, ...@@ -89,6 +89,8 @@ extern struct rt6_info * rt6_add_dflt_router(struct in6_addr *gwaddr,
extern void rt6_purge_dflt_routers(int lst_resort); extern void rt6_purge_dflt_routers(int lst_resort);
extern void rt6_reset_dflt_pointer(struct rt6_info *rt);
extern void rt6_redirect(struct in6_addr *dest, extern void rt6_redirect(struct in6_addr *dest,
struct in6_addr *saddr, struct in6_addr *saddr,
struct neighbour *neigh, struct neighbour *neigh,
......
...@@ -49,9 +49,6 @@ ...@@ -49,9 +49,6 @@
struct rt6_statistics rt6_stats; struct rt6_statistics rt6_stats;
extern struct rt6_info *rt6_dflt_pointer;
extern spinlock_t rt6_dflt_lock;
static kmem_cache_t * fib6_node_kmem; static kmem_cache_t * fib6_node_kmem;
enum fib_walk_state_t enum fib_walk_state_t
...@@ -1187,10 +1184,7 @@ static int fib6_age(struct rt6_info *rt, void *arg) ...@@ -1187,10 +1184,7 @@ static int fib6_age(struct rt6_info *rt, void *arg)
if (rt->rt6i_flags&RTF_EXPIRES && rt->rt6i_expires) { if (rt->rt6i_flags&RTF_EXPIRES && rt->rt6i_expires) {
if (time_after(now, rt->rt6i_expires)) { if (time_after(now, rt->rt6i_expires)) {
RT6_TRACE("expiring %p\n", rt); RT6_TRACE("expiring %p\n", rt);
spin_lock_bh(&rt6_dflt_lock); rt6_reset_dflt_pointer(rt);
if (rt == rt6_dflt_pointer)
rt6_dflt_pointer = NULL;
spin_unlock_bh(&rt6_dflt_lock);
return -1; return -1;
} }
gc_args.more++; gc_args.more++;
......
...@@ -211,6 +211,16 @@ static __inline__ struct rt6_info *rt6_device_match(struct rt6_info *rt, ...@@ -211,6 +211,16 @@ static __inline__ struct rt6_info *rt6_device_match(struct rt6_info *rt,
struct rt6_info *rt6_dflt_pointer; struct rt6_info *rt6_dflt_pointer;
spinlock_t rt6_dflt_lock = SPIN_LOCK_UNLOCKED; spinlock_t rt6_dflt_lock = SPIN_LOCK_UNLOCKED;
void rt6_reset_dflt_pointer(struct rt6_info *rt)
{
spin_lock_bh(&rt6_dflt_lock);
if (rt == NULL || rt == rt6_dflt_pointer) {
RT6_TRACE("reset default router: %p->NULL\n", rt6_dflt_pointer);
rt6_dflt_pointer = NULL;
}
spin_unlock_bh(&rt6_dflt_lock);
}
/* Default Router Selection (RFC 2461 6.3.6) */ /* Default Router Selection (RFC 2461 6.3.6) */
static struct rt6_info *rt6_best_dflt(struct rt6_info *rt, int oif) static struct rt6_info *rt6_best_dflt(struct rt6_info *rt, int oif)
{ {
...@@ -960,9 +970,7 @@ int ip6_del_rt(struct rt6_info *rt, struct nlmsghdr *nlh, void *_rtattr) ...@@ -960,9 +970,7 @@ int ip6_del_rt(struct rt6_info *rt, struct nlmsghdr *nlh, void *_rtattr)
write_lock_bh(&rt6_lock); write_lock_bh(&rt6_lock);
spin_lock_bh(&rt6_dflt_lock); rt6_reset_dflt_pointer(NULL);
rt6_dflt_pointer = NULL;
spin_unlock_bh(&rt6_dflt_lock);
dst_release(&rt->u.dst); dst_release(&rt->u.dst);
...@@ -1289,9 +1297,7 @@ void rt6_purge_dflt_routers(int last_resort) ...@@ -1289,9 +1297,7 @@ void rt6_purge_dflt_routers(int last_resort)
if (rt->rt6i_flags & flags) { if (rt->rt6i_flags & flags) {
dst_hold(&rt->u.dst); dst_hold(&rt->u.dst);
spin_lock_bh(&rt6_dflt_lock); rt6_reset_dflt_pointer(NULL);
rt6_dflt_pointer = NULL;
spin_unlock_bh(&rt6_dflt_lock);
read_unlock_bh(&rt6_lock); read_unlock_bh(&rt6_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment