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);
108108void ila_lwt_fini (void );
109109
110110int ila_xlat_init_net (struct net * net );
111+ void ila_xlat_pre_exit_net (struct net * net );
111112void ila_xlat_exit_net (struct net * net );
112113
113114int 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)
7171 return err ;
7272}
7373
74+ static __net_exit void ila_pre_exit_net (struct net * net )
75+ {
76+ ila_xlat_pre_exit_net (net );
77+ }
78+
7479static __net_exit void ila_exit_net (struct net * net )
7580{
7681 ila_xlat_exit_net (net );
7782}
7883
7984static struct pernet_operations ila_net_ops = {
8085 .init = ila_init_net ,
86+ .pre_exit = ila_pre_exit_net ,
8187 .exit = ila_exit_net ,
8288 .id = & ila_net_id ,
8389 .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)
619619 return 0 ;
620620}
621621
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+
622631void ila_xlat_exit_net (struct net * net )
623632{
624633 struct ila_net * ilan = net_generic (net , ila_net_id );
625634
626635 rhashtable_free_and_destroy (& ilan -> xlat .rhash_table , ila_free_cb , NULL );
627636
628637 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 ));
633638}
634639
635640static int ila_xlat_addr (struct sk_buff * skb , bool sir2ila )
You can’t perform that action at this time.
0 commit comments