]> Pileus Git - ~andy/linux/commitdiff
ipv6: remove rt6i_peer_genid from rt6_info and its handler
authorLi RongQing <roy.qing.li@gmail.com>
Wed, 7 Nov 2012 21:56:33 +0000 (21:56 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 Nov 2012 02:16:08 +0000 (21:16 -0500)
6431cbc25f(Create a mechanism for upward inetpeer propagation into routes)
introduces these codes, but this mechanism is never enabled since
rt6i_peer_genid always is zero whether it is not assigned or assigned by
rt6_peer_genid(). After 5943634fc5 (ipv4: Maintain redirect and PMTU info
in struct rtable again), the ipv4 related codes of this mechanism has been
removed, I think we maybe able to remove them now.

Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/ip6_fib.h
net/ipv6/route.c

index d1327e4d126bc8cf5fd8bc8197ade3ef08fae4cf..fdc48a94a063ae8ce746c501a477ab3471ab028e 100644 (file)
@@ -117,7 +117,6 @@ struct rt6_info {
        struct rt6key                   rt6i_src;
        struct rt6key                   rt6i_prefsrc;
        u32                             rt6i_metric;
-       u32                             rt6i_peer_genid;
 
        struct inet6_dev                *rt6i_idev;
        unsigned long                   _rt6i_peer;
index c1cfcb7e563298db86e555567f7e1e6e33335bce..6863f8b43bbd2c7708e534d64b39dc86b9d03662 100644 (file)
@@ -321,13 +321,6 @@ static void ip6_dst_destroy(struct dst_entry *dst)
        }
 }
 
-static atomic_t __rt6_peer_genid = ATOMIC_INIT(0);
-
-static u32 rt6_peer_genid(void)
-{
-       return atomic_read(&__rt6_peer_genid);
-}
-
 void rt6_bind_peer(struct rt6_info *rt, int create)
 {
        struct inet_peer_base *base;
@@ -341,8 +334,6 @@ void rt6_bind_peer(struct rt6_info *rt, int create)
        if (peer) {
                if (!rt6_set_peer(rt, peer))
                        inet_putpeer(peer);
-               else
-                       rt->rt6i_peer_genid = rt6_peer_genid();
        }
 }
 
@@ -1099,14 +1090,9 @@ static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie)
        if (rt->rt6i_genid != rt_genid(dev_net(rt->dst.dev)))
                return NULL;
 
-       if (rt->rt6i_node && (rt->rt6i_node->fn_sernum == cookie)) {
-               if (rt->rt6i_peer_genid != rt6_peer_genid()) {
-                       if (!rt6_has_peer(rt))
-                               rt6_bind_peer(rt, 0);
-                       rt->rt6i_peer_genid = rt6_peer_genid();
-               }
+       if (rt->rt6i_node && (rt->rt6i_node->fn_sernum == cookie))
                return dst;
-       }
+
        return NULL;
 }