File tree Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ int ila_lwt_init(void);
108
108
void ila_lwt_fini (void );
109
109
110
110
int ila_xlat_init_net (struct net * net );
111
+ void ila_xlat_pre_exit_net (struct net * net );
111
112
void ila_xlat_exit_net (struct net * net );
112
113
113
114
int ila_xlat_nl_cmd_add_mapping (struct sk_buff * skb , struct genl_info * info );
Original file line number Diff line number Diff line change @@ -71,13 +71,19 @@ static __net_init int ila_init_net(struct net *net)
71
71
return err ;
72
72
}
73
73
74
+ static __net_exit void ila_pre_exit_net (struct net * net )
75
+ {
76
+ ila_xlat_pre_exit_net (net );
77
+ }
78
+
74
79
static __net_exit void ila_exit_net (struct net * net )
75
80
{
76
81
ila_xlat_exit_net (net );
77
82
}
78
83
79
84
static struct pernet_operations ila_net_ops = {
80
85
.init = ila_init_net ,
86
+ .pre_exit = ila_pre_exit_net ,
81
87
.exit = ila_exit_net ,
82
88
.id = & ila_net_id ,
83
89
.size = sizeof (struct ila_net ),
Original file line number Diff line number Diff line change @@ -619,17 +619,22 @@ int ila_xlat_init_net(struct net *net)
619
619
return 0 ;
620
620
}
621
621
622
+ void ila_xlat_pre_exit_net (struct net * net )
623
+ {
624
+ struct ila_net * ilan = net_generic (net , ila_net_id );
625
+
626
+ if (ilan -> xlat .hooks_registered )
627
+ nf_unregister_net_hooks (net , ila_nf_hook_ops ,
628
+ ARRAY_SIZE (ila_nf_hook_ops ));
629
+ }
630
+
622
631
void ila_xlat_exit_net (struct net * net )
623
632
{
624
633
struct ila_net * ilan = net_generic (net , ila_net_id );
625
634
626
635
rhashtable_free_and_destroy (& ilan -> xlat .rhash_table , ila_free_cb , NULL );
627
636
628
637
free_bucket_spinlocks (ilan -> xlat .locks );
629
-
630
- if (ilan -> xlat .hooks_registered )
631
- nf_unregister_net_hooks (net , ila_nf_hook_ops ,
632
- ARRAY_SIZE (ila_nf_hook_ops ));
633
638
}
634
639
635
640
static int ila_xlat_addr (struct sk_buff * skb , bool sir2ila )
You can’t perform that action at this time.
0 commit comments