aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/ip6_route.h8
-rw-r--r--net/ipv6/ip6_fib.c2
-rw-r--r--net/ipv6/ndisc.c2
-rw-r--r--net/ipv6/route.c27
4 files changed, 19 insertions, 20 deletions
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index f99e4f0f568f..8d155a645aba 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -73,11 +73,11 @@ extern struct rt6_info *rt6_lookup(struct in6_addr *daddr,
73 struct in6_addr *saddr, 73 struct in6_addr *saddr,
74 int oif, int flags); 74 int oif, int flags);
75 75
76extern struct dst_entry *ndisc_dst_alloc(struct net_device *dev, 76extern struct dst_entry *icmp6_dst_alloc(struct net_device *dev,
77 struct neighbour *neigh, 77 struct neighbour *neigh,
78 struct in6_addr *addr, 78 struct in6_addr *addr);
79 int (*output)(struct sk_buff *)); 79extern int icmp6_dst_gc(int *more);
80extern int ndisc_dst_gc(int *more); 80
81extern void fib6_force_start_gc(void); 81extern void fib6_force_start_gc(void);
82 82
83extern struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev, 83extern struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev,
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index bab72b6f1444..c70fd38b54b7 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -1464,7 +1464,7 @@ void fib6_run_gc(unsigned long dummy)
1464 } 1464 }
1465 gc_args.more = 0; 1465 gc_args.more = 0;
1466 1466
1467 ndisc_dst_gc(&gc_args.more); 1467 icmp6_dst_gc(&gc_args.more);
1468 fib6_clean_all(fib6_age, 0, NULL); 1468 fib6_clean_all(fib6_age, 0, NULL);
1469 1469
1470 if (gc_args.more) 1470 if (gc_args.more)
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 8db5f4a419aa..eb322959a3e1 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -462,7 +462,7 @@ static void __ndisc_send(struct net_device *dev,
462 icmpv6_flow_init(ndisc_socket->sk, &fl, type, 462 icmpv6_flow_init(ndisc_socket->sk, &fl, type,
463 saddr, daddr, dev->ifindex); 463 saddr, daddr, dev->ifindex);
464 464
465 dst = ndisc_dst_alloc(dev, neigh, daddr, ip6_output); 465 dst = icmp6_dst_alloc(dev, neigh, daddr);
466 if (!dst) 466 if (!dst)
467 return; 467 return;
468 468
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 6abe7da45ef7..cd717450fb10 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -904,13 +904,12 @@ static inline unsigned int ipv6_advmss(unsigned int mtu)
904 return mtu; 904 return mtu;
905} 905}
906 906
907static struct dst_entry *ndisc_dst_gc_list; 907static struct dst_entry *icmp6_dst_gc_list;
908static DEFINE_SPINLOCK(ndisc_lock); 908static DEFINE_SPINLOCK(icmp6_dst_lock);
909 909
910struct dst_entry *ndisc_dst_alloc(struct net_device *dev, 910struct dst_entry *icmp6_dst_alloc(struct net_device *dev,
911 struct neighbour *neigh, 911 struct neighbour *neigh,
912 struct in6_addr *addr, 912 struct in6_addr *addr)
913 int (*output)(struct sk_buff *))
914{ 913{
915 struct rt6_info *rt; 914 struct rt6_info *rt;
916 struct inet6_dev *idev = in6_dev_get(dev); 915 struct inet6_dev *idev = in6_dev_get(dev);
@@ -937,7 +936,7 @@ struct dst_entry *ndisc_dst_alloc(struct net_device *dev,
937 rt->u.dst.metrics[RTAX_HOPLIMIT-1] = 255; 936 rt->u.dst.metrics[RTAX_HOPLIMIT-1] = 255;
938 rt->u.dst.metrics[RTAX_MTU-1] = ipv6_get_mtu(rt->rt6i_dev); 937 rt->u.dst.metrics[RTAX_MTU-1] = ipv6_get_mtu(rt->rt6i_dev);
939 rt->u.dst.metrics[RTAX_ADVMSS-1] = ipv6_advmss(dst_mtu(&rt->u.dst)); 938 rt->u.dst.metrics[RTAX_ADVMSS-1] = ipv6_advmss(dst_mtu(&rt->u.dst));
940 rt->u.dst.output = output; 939 rt->u.dst.output = ip6_output;
941 940
942#if 0 /* there's no chance to use these for ndisc */ 941#if 0 /* there's no chance to use these for ndisc */
943 rt->u.dst.flags = ipv6_addr_type(addr) & IPV6_ADDR_UNICAST 942 rt->u.dst.flags = ipv6_addr_type(addr) & IPV6_ADDR_UNICAST
@@ -947,10 +946,10 @@ struct dst_entry *ndisc_dst_alloc(struct net_device *dev,
947 rt->rt6i_dst.plen = 128; 946 rt->rt6i_dst.plen = 128;
948#endif 947#endif
949 948
950 spin_lock_bh(&ndisc_lock); 949 spin_lock_bh(&icmp6_dst_lock);
951 rt->u.dst.next = ndisc_dst_gc_list; 950 rt->u.dst.next = icmp6_dst_gc_list;
952 ndisc_dst_gc_list = &rt->u.dst; 951 icmp6_dst_gc_list = &rt->u.dst;
953 spin_unlock_bh(&ndisc_lock); 952 spin_unlock_bh(&icmp6_dst_lock);
954 953
955 fib6_force_start_gc(); 954 fib6_force_start_gc();
956 955
@@ -958,7 +957,7 @@ out:
958 return &rt->u.dst; 957 return &rt->u.dst;
959} 958}
960 959
961int ndisc_dst_gc(int *more) 960int icmp6_dst_gc(int *more)
962{ 961{
963 struct dst_entry *dst, *next, **pprev; 962 struct dst_entry *dst, *next, **pprev;
964 int freed; 963 int freed;
@@ -966,8 +965,8 @@ int ndisc_dst_gc(int *more)
966 next = NULL; 965 next = NULL;
967 freed = 0; 966 freed = 0;
968 967
969 spin_lock_bh(&ndisc_lock); 968 spin_lock_bh(&icmp6_dst_lock);
970 pprev = &ndisc_dst_gc_list; 969 pprev = &icmp6_dst_gc_list;
971 970
972 while ((dst = *pprev) != NULL) { 971 while ((dst = *pprev) != NULL) {
973 if (!atomic_read(&dst->__refcnt)) { 972 if (!atomic_read(&dst->__refcnt)) {
@@ -980,7 +979,7 @@ int ndisc_dst_gc(int *more)
980 } 979 }
981 } 980 }
982 981
983 spin_unlock_bh(&ndisc_lock); 982 spin_unlock_bh(&icmp6_dst_lock);
984 983
985 return freed; 984 return freed;
986} 985}