]> git.hungrycats.org Git - linux/commitdiff
[IPV6]: dst_alloc() clean-up.
authorHideaki Yoshifuji <yoshfuji@linux-ipv6.org>
Tue, 22 Apr 2003 16:57:57 +0000 (09:57 -0700)
committerArnaldo Carvalho de Melo <acme@conectiva.com.br>
Tue, 22 Apr 2003 16:57:57 +0000 (09:57 -0700)
include/net/ip6_route.h
net/ipv6/ndisc.c
net/ipv6/route.c

index 1a5c99c5afa203cfa507f0d4bfb11f12c6551c70..1af054ea638546f725beef6aadf7cb31c80cdad6 100644 (file)
@@ -59,7 +59,7 @@ extern struct rt6_info                *rt6_lookup(struct in6_addr *daddr,
                                            struct in6_addr *saddr,
                                            int oif, int flags);
 
-extern struct rt6_info         *ndisc_get_dummy_rt(void);
+extern struct rt6_info         *ip6_dst_alloc(void);
 
 /*
  *     support functions for ND
index c5b38160717dd1764aa4f79ebb17e8c1871a7199..7688f0ce1e5bb43cc776168d9620799fd54eb773 100644 (file)
@@ -427,7 +427,7 @@ static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh,
 
        len = sizeof(struct icmp6hdr) + sizeof(struct in6_addr);
 
-       rt = ndisc_get_dummy_rt();
+       rt = ip6_dst_alloc();
        if (!rt) 
                return;
 
@@ -524,7 +524,7 @@ void ndisc_send_ns(struct net_device *dev, struct neighbour *neigh,
                saddr = &addr_buf;
        }
 
-       rt = ndisc_get_dummy_rt();
+       rt = ip6_dst_alloc();
        if (!rt) 
                return;
 
@@ -595,7 +595,7 @@ void ndisc_send_rs(struct net_device *dev, struct in6_addr *saddr,
         int len;
        int err;
 
-       rt = ndisc_get_dummy_rt();
+       rt = ip6_dst_alloc();
        if (!rt) 
                return;
 
index c855580c278a22e0d596eda6b160cdcc67a44348..67eae08db2cae7f6c6abd9a01b0c3ea55f778b14 100644 (file)
@@ -130,12 +130,17 @@ struct fib6_node ip6_routing_table = {
 rwlock_t rt6_lock = RW_LOCK_UNLOCKED;
 
 
-/*     Dummy rt for ndisc */
-struct rt6_info *ndisc_get_dummy_rt()
+/* allocate dst with ip6_dst_ops */
+static __inline__ struct rt6_info *__ip6_dst_alloc(void)
 {
        return dst_alloc(&ip6_dst_ops);
 }
 
+struct rt6_info *ip6_dst_alloc(void)
+{
+       return __ip6_dst_alloc();
+}
+
 /*
  *     Route lookup. Any rt6_lock is implied.
  */
@@ -640,7 +645,7 @@ int ip6_route_add(struct in6_rtmsg *rtmsg, struct nlmsghdr *nlh)
        if (rtmsg->rtmsg_metric == 0)
                rtmsg->rtmsg_metric = IP6_RT_PRIO_USER;
 
-       rt = dst_alloc(&ip6_dst_ops);
+       rt = __ip6_dst_alloc();
 
        if (rt == NULL)
                return -ENOMEM;
@@ -1035,9 +1040,7 @@ out:
 
 static struct rt6_info * ip6_rt_copy(struct rt6_info *ort)
 {
-       struct rt6_info *rt;
-
-       rt = dst_alloc(&ip6_dst_ops);
+       struct rt6_info *rt = __ip6_dst_alloc();
 
        if (rt) {
                rt->u.dst.input = ort->u.dst.input;
@@ -1181,9 +1184,8 @@ int ip6_pkt_discard(struct sk_buff *skb)
 
 int ip6_rt_addr_add(struct in6_addr *addr, struct net_device *dev)
 {
-       struct rt6_info *rt;
+       struct rt6_info *rt = __ip6_dst_alloc();
 
-       rt = dst_alloc(&ip6_dst_ops);
        if (rt == NULL)
                return -ENOMEM;