File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -325,6 +325,11 @@ static inline int check_net(const struct net *net)
325
325
#define net_drop_ns NULL
326
326
#endif
327
327
328
+ /* Returns true if the netns initialization is completed successfully */
329
+ static inline bool net_initialized (const struct net * net )
330
+ {
331
+ return READ_ONCE (net -> list .next );
332
+ }
328
333
329
334
static inline void __netns_tracker_alloc (struct net * net ,
330
335
netns_tracker * tracker ,
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ static void ipmr_expire_process(struct timer_list *t);
122
122
123
123
static bool ipmr_can_free_table (struct net * net )
124
124
{
125
- return !check_net (net ) || !net -> ipv4 . mr_rules_ops ;
125
+ return !check_net (net ) || !net_initialized ( net ) ;
126
126
}
127
127
128
128
static struct mr_table * ipmr_mr_table_iter (struct net * net ,
Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ static void ipmr_expire_process(struct timer_list *t);
110
110
111
111
static bool ip6mr_can_free_table (struct net * net )
112
112
{
113
- return !check_net (net ) || !net -> ipv6 . mr6_rules_ops ;
113
+ return !check_net (net ) || !net_initialized ( net ) ;
114
114
}
115
115
116
116
static struct mr_table * ip6mr_mr_table_iter (struct net * net ,
You can’t perform that action at this time.
0 commit comments