|
@@ -319,6 +319,15 @@ static const struct rt6_info ip6_blk_hole_entry_template = {
|
|
|
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+static void rt6_info_init(struct rt6_info *rt)
|
|
|
|
+{
|
|
|
|
+ struct dst_entry *dst = &rt->dst;
|
|
|
|
+
|
|
|
|
+ memset(dst + 1, 0, sizeof(*rt) - sizeof(*dst));
|
|
|
|
+ INIT_LIST_HEAD(&rt->rt6i_siblings);
|
|
|
|
+ INIT_LIST_HEAD(&rt->rt6i_uncached);
|
|
|
|
+}
|
|
|
|
+
|
|
/* allocate dst with ip6_dst_ops */
|
|
/* allocate dst with ip6_dst_ops */
|
|
static struct rt6_info *__ip6_dst_alloc(struct net *net,
|
|
static struct rt6_info *__ip6_dst_alloc(struct net *net,
|
|
struct net_device *dev,
|
|
struct net_device *dev,
|
|
@@ -327,13 +336,9 @@ static struct rt6_info *__ip6_dst_alloc(struct net *net,
|
|
struct rt6_info *rt = dst_alloc(&net->ipv6.ip6_dst_ops, dev,
|
|
struct rt6_info *rt = dst_alloc(&net->ipv6.ip6_dst_ops, dev,
|
|
0, DST_OBSOLETE_FORCE_CHK, flags);
|
|
0, DST_OBSOLETE_FORCE_CHK, flags);
|
|
|
|
|
|
- if (rt) {
|
|
|
|
- struct dst_entry *dst = &rt->dst;
|
|
|
|
|
|
+ if (rt)
|
|
|
|
+ rt6_info_init(rt);
|
|
|
|
|
|
- memset(dst + 1, 0, sizeof(*rt) - sizeof(*dst));
|
|
|
|
- INIT_LIST_HEAD(&rt->rt6i_siblings);
|
|
|
|
- INIT_LIST_HEAD(&rt->rt6i_uncached);
|
|
|
|
- }
|
|
|
|
return rt;
|
|
return rt;
|
|
}
|
|
}
|
|
|
|
|