diff options
| -rw-r--r-- | include/net/netfilter/nf_tables.h | 2 | ||||
| -rw-r--r-- | net/netfilter/nf_tables_api.c | 29 | ||||
| -rw-r--r-- | net/netfilter/nft_chain_filter.c | 2 |
3 files changed, 24 insertions, 9 deletions
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h index 552bfbef1bf1..0f39ac487012 100644 --- a/include/net/netfilter/nf_tables.h +++ b/include/net/netfilter/nf_tables.h | |||
| @@ -1374,6 +1374,6 @@ struct nft_trans_flowtable { | |||
| 1374 | (((struct nft_trans_flowtable *)trans->data)->flowtable) | 1374 | (((struct nft_trans_flowtable *)trans->data)->flowtable) |
| 1375 | 1375 | ||
| 1376 | int __init nft_chain_filter_init(void); | 1376 | int __init nft_chain_filter_init(void); |
| 1377 | void __exit nft_chain_filter_fini(void); | 1377 | void nft_chain_filter_fini(void); |
| 1378 | 1378 | ||
| 1379 | #endif /* _NET_NF_TABLES_H */ | 1379 | #endif /* _NET_NF_TABLES_H */ |
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 3008f93469c4..80636cc59686 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c | |||
| @@ -7273,21 +7273,36 @@ static int __init nf_tables_module_init(void) | |||
| 7273 | { | 7273 | { |
| 7274 | int err; | 7274 | int err; |
| 7275 | 7275 | ||
| 7276 | nft_chain_filter_init(); | 7276 | err = register_pernet_subsys(&nf_tables_net_ops); |
| 7277 | if (err < 0) | ||
| 7278 | return err; | ||
| 7279 | |||
| 7280 | err = nft_chain_filter_init(); | ||
| 7281 | if (err < 0) | ||
| 7282 | goto err1; | ||
| 7277 | 7283 | ||
| 7278 | err = nf_tables_core_module_init(); | 7284 | err = nf_tables_core_module_init(); |
| 7279 | if (err < 0) | 7285 | if (err < 0) |
| 7280 | return err; | 7286 | goto err2; |
| 7281 | 7287 | ||
| 7282 | err = nfnetlink_subsys_register(&nf_tables_subsys); | 7288 | err = register_netdevice_notifier(&nf_tables_flowtable_notifier); |
| 7283 | if (err < 0) | 7289 | if (err < 0) |
| 7284 | goto err; | 7290 | goto err3; |
| 7285 | 7291 | ||
| 7286 | register_netdevice_notifier(&nf_tables_flowtable_notifier); | 7292 | /* must be last */ |
| 7293 | err = nfnetlink_subsys_register(&nf_tables_subsys); | ||
| 7294 | if (err < 0) | ||
| 7295 | goto err4; | ||
| 7287 | 7296 | ||
| 7288 | return register_pernet_subsys(&nf_tables_net_ops); | 7297 | return err; |
| 7289 | err: | 7298 | err4: |
| 7299 | unregister_netdevice_notifier(&nf_tables_flowtable_notifier); | ||
| 7300 | err3: | ||
| 7290 | nf_tables_core_module_exit(); | 7301 | nf_tables_core_module_exit(); |
| 7302 | err2: | ||
| 7303 | nft_chain_filter_fini(); | ||
| 7304 | err1: | ||
| 7305 | unregister_pernet_subsys(&nf_tables_net_ops); | ||
| 7291 | return err; | 7306 | return err; |
| 7292 | } | 7307 | } |
| 7293 | 7308 | ||
diff --git a/net/netfilter/nft_chain_filter.c b/net/netfilter/nft_chain_filter.c index ea5b7c4944f6..9d07b277b9ee 100644 --- a/net/netfilter/nft_chain_filter.c +++ b/net/netfilter/nft_chain_filter.c | |||
| @@ -392,7 +392,7 @@ int __init nft_chain_filter_init(void) | |||
| 392 | return 0; | 392 | return 0; |
| 393 | } | 393 | } |
| 394 | 394 | ||
| 395 | void __exit nft_chain_filter_fini(void) | 395 | void nft_chain_filter_fini(void) |
| 396 | { | 396 | { |
| 397 | nft_chain_filter_bridge_fini(); | 397 | nft_chain_filter_bridge_fini(); |
| 398 | nft_chain_filter_inet_fini(); | 398 | nft_chain_filter_inet_fini(); |
