diff options
author | Phil Sutter <phil@nwl.cc> | 2019-10-17 22:49:26 +0200 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2019-10-18 11:57:31 +0200 |
commit | eedb0bb2ad01cf1d3af6fe3d644660ab81c1fc29 (patch) | |
tree | afb7d402bbc257d6964dad8e05b21495ede78d1a | |
parent | 4abb44c978d75656f69dd59f24522eb970881ccf (diff) |
xtables-restore: Constify struct nft_xt_restore_cb
There is no need for dynamic callback mangling, so make all instances
static const.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | iptables/nft-shared.h | 2 | ||||
-rw-r--r-- | iptables/xtables-restore.c | 8 | ||||
-rw-r--r-- | iptables/xtables-translate.c | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/iptables/nft-shared.h b/iptables/nft-shared.h index 5c664150..b062f3e5 100644 --- a/iptables/nft-shared.h +++ b/iptables/nft-shared.h @@ -262,7 +262,7 @@ struct nft_xt_restore_cb { void xtables_restore_parse(struct nft_handle *h, const struct nft_xt_restore_parse *p, - struct nft_xt_restore_cb *cb); + const struct nft_xt_restore_cb *cb); void nft_check_xt_legacy(int family, bool is_ipt_save); #endif diff --git a/iptables/xtables-restore.c b/iptables/xtables-restore.c index 4652d631..df884420 100644 --- a/iptables/xtables-restore.c +++ b/iptables/xtables-restore.c @@ -70,7 +70,7 @@ static struct nftnl_chain_list *get_chain_list(struct nft_handle *h, return chain_list; } -struct nft_xt_restore_cb restore_cb = { +static const struct nft_xt_restore_cb restore_cb = { .chain_list = get_chain_list, .commit = nft_commit, .abort = nft_abort, @@ -87,7 +87,7 @@ static const struct xtc_ops xtc_ops = { void xtables_restore_parse(struct nft_handle *h, const struct nft_xt_restore_parse *p, - struct nft_xt_restore_cb *cb) + const struct nft_xt_restore_cb *cb) { const struct builtin_table *curtable = NULL; char buffer[10240]; @@ -432,7 +432,7 @@ static int ebt_table_flush(struct nft_handle *h, const char *table) return nft_table_flush(h, table); } -struct nft_xt_restore_cb ebt_restore_cb = { +static const struct nft_xt_restore_cb ebt_restore_cb = { .chain_list = get_chain_list, .commit = nft_bridge_commit, .table_new = nft_table_new, @@ -478,7 +478,7 @@ int xtables_eb_restore_main(int argc, char *argv[]) return 0; } -struct nft_xt_restore_cb arp_restore_cb = { +static const struct nft_xt_restore_cb arp_restore_cb = { .chain_list = get_chain_list, .commit = nft_commit, .table_new = nft_table_new, diff --git a/iptables/xtables-translate.c b/iptables/xtables-translate.c index 64e7667a..43607901 100644 --- a/iptables/xtables-translate.c +++ b/iptables/xtables-translate.c @@ -413,7 +413,7 @@ static int dummy_compat_rev(const char *name, uint8_t rev, int opt) return 1; } -static struct nft_xt_restore_cb cb_xlate = { +static const struct nft_xt_restore_cb cb_xlate = { .table_new = xlate_table_new, .chain_set = xlate_chain_set, .chain_restore = xlate_chain_user_restore, |