From f88bc3d228428b8a7eeb5c6cba7e714fbfa1c2ad Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 17 Oct 2019 23:20:22 +0200 Subject: iptables-restore: Constify struct iptables_restore_cb Just like with xtables-restore, these callbacks don't change at run-time. Signed-off-by: Phil Sutter Acked-by: Pablo Neira Ayuso --- iptables/iptables-restore.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'iptables') diff --git a/iptables/iptables-restore.c b/iptables/iptables-restore.c index 3655b3e8..50d0708e 100644 --- a/iptables/iptables-restore.c +++ b/iptables/iptables-restore.c @@ -70,7 +70,7 @@ struct iptables_restore_cb { }; static struct xtc_handle * -create_handle(struct iptables_restore_cb *cb, const char *tablename) +create_handle(const struct iptables_restore_cb *cb, const char *tablename) { struct xtc_handle *handle; @@ -90,7 +90,8 @@ create_handle(struct iptables_restore_cb *cb, const char *tablename) } static int -ip46tables_restore_main(struct iptables_restore_cb *cb, int argc, char *argv[]) +ip46tables_restore_main(const struct iptables_restore_cb *cb, + int argc, char *argv[]) { struct xtc_handle *handle = NULL; char buffer[10240]; @@ -360,7 +361,7 @@ ip46tables_restore_main(struct iptables_restore_cb *cb, int argc, char *argv[]) #if defined ENABLE_IPV4 -struct iptables_restore_cb ipt_restore_cb = { +static const struct iptables_restore_cb ipt_restore_cb = { .ops = &iptc_ops, .for_each_chain = for_each_chain4, .flush_entries = flush_entries4, @@ -391,7 +392,7 @@ iptables_restore_main(int argc, char *argv[]) #endif #if defined ENABLE_IPV6 -struct iptables_restore_cb ip6t_restore_cb = { +static const struct iptables_restore_cb ip6t_restore_cb = { .ops = &ip6tc_ops, .for_each_chain = for_each_chain6, .flush_entries = flush_entries6, -- cgit v1.2.3