Skip to content

Commit a4477c4

Browse files
Li RongQingdavem330
authored andcommitted
ipv6: remove rt6i_peer_genid from rt6_info and its handler
6431cbc(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 5943634 (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>
1 parent f1e0b5b commit a4477c4

2 files changed

Lines changed: 2 additions & 17 deletions

File tree

‎include/net/ip6_fib.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ struct rt6_info {
117117
struct rt6key rt6i_src;
118118
struct rt6key rt6i_prefsrc;
119119
u32 rt6i_metric;
120-
u32 rt6i_peer_genid;
121120

122121
struct inet6_dev *rt6i_idev;
123122
unsigned long _rt6i_peer;

‎net/ipv6/route.c‎

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -321,13 +321,6 @@ static void ip6_dst_destroy(struct dst_entry *dst)
321321
}
322322
}
323323

324-
static atomic_t __rt6_peer_genid = ATOMIC_INIT(0);
325-
326-
static u32 rt6_peer_genid(void)
327-
{
328-
return atomic_read(&__rt6_peer_genid);
329-
}
330-
331324
void rt6_bind_peer(struct rt6_info *rt, int create)
332325
{
333326
struct inet_peer_base *base;
@@ -341,8 +334,6 @@ void rt6_bind_peer(struct rt6_info *rt, int create)
341334
if (peer) {
342335
if (!rt6_set_peer(rt, peer))
343336
inet_putpeer(peer);
344-
else
345-
rt->rt6i_peer_genid = rt6_peer_genid();
346337
}
347338
}
348339

@@ -1099,14 +1090,9 @@ static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie)
10991090
if (rt->rt6i_genid != rt_genid(dev_net(rt->dst.dev)))
11001091
return NULL;
11011092

1102-
if (rt->rt6i_node && (rt->rt6i_node->fn_sernum == cookie)) {
1103-
if (rt->rt6i_peer_genid != rt6_peer_genid()) {
1104-
if (!rt6_has_peer(rt))
1105-
rt6_bind_peer(rt, 0);
1106-
rt->rt6i_peer_genid = rt6_peer_genid();
1107-
}
1093+
if (rt->rt6i_node && (rt->rt6i_node->fn_sernum == cookie))
11081094
return dst;
1109-
}
1095+
11101096
return NULL;
11111097
}
11121098

0 commit comments

Comments
 (0)