Skip to content

Commit 7410921

Browse files
tracywwnjdavem330
authored andcommitted
ipv6: initialize rt6->rt6i_uncached in all pre-allocated dst entries
Initialize rt6->rt6i_uncached on the following pre-allocated dsts: net->ipv6.ip6_null_entry net->ipv6.ip6_prohibit_entry net->ipv6.ip6_blk_hole_entry This is a preparation patch for later commits to be able to distinguish dst entries in uncached list by doing: !list_empty(rt6->rt6i_uncached) Signed-off-by: Wei Wang <[email protected]> Acked-by: Eric Dumazet <[email protected]> Acked-by: Mahesh Bandewar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0e09edc commit 7410921

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/ipv6/route.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6016,6 +6016,7 @@ static int __net_init ip6_route_net_init(struct net *net)
60166016
net->ipv6.ip6_null_entry->dst.ops = &net->ipv6.ip6_dst_ops;
60176017
dst_init_metrics(&net->ipv6.ip6_null_entry->dst,
60186018
ip6_template_metrics, true);
6019+
INIT_LIST_HEAD(&net->ipv6.ip6_null_entry->rt6i_uncached);
60196020

60206021
#ifdef CONFIG_IPV6_MULTIPLE_TABLES
60216022
net->ipv6.fib6_has_custom_rules = false;
@@ -6027,6 +6028,7 @@ static int __net_init ip6_route_net_init(struct net *net)
60276028
net->ipv6.ip6_prohibit_entry->dst.ops = &net->ipv6.ip6_dst_ops;
60286029
dst_init_metrics(&net->ipv6.ip6_prohibit_entry->dst,
60296030
ip6_template_metrics, true);
6031+
INIT_LIST_HEAD(&net->ipv6.ip6_prohibit_entry->rt6i_uncached);
60306032

60316033
net->ipv6.ip6_blk_hole_entry = kmemdup(&ip6_blk_hole_entry_template,
60326034
sizeof(*net->ipv6.ip6_blk_hole_entry),
@@ -6036,6 +6038,7 @@ static int __net_init ip6_route_net_init(struct net *net)
60366038
net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops;
60376039
dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst,
60386040
ip6_template_metrics, true);
6041+
INIT_LIST_HEAD(&net->ipv6.ip6_blk_hole_entry->rt6i_uncached);
60396042
#endif
60406043

60416044
net->ipv6.sysctl.flush_delay = 0;

0 commit comments

Comments
 (0)