summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2019-10-17 23:20:22 +0200
committerPhil Sutter <phil@nwl.cc>2019-10-18 11:57:35 +0200
commitf88bc3d228428b8a7eeb5c6cba7e714fbfa1c2ad (patch)
tree1a358408805aafc57a228a3de555b57d7f6425a5
parenteedb0bb2ad01cf1d3af6fe3d644660ab81c1fc29 (diff)
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 <phil@nwl.cc> Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--iptables/iptables-restore.c9
1 files changed, 5 insertions, 4 deletions
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,