From 9d6200d6e3c41dce0fbbbb1a212c027a96f7be14 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 30 Apr 2013 21:33:37 +0200 Subject: [PATCH] Record default policies in state file --- utils.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/utils.c b/utils.c index a728e77..409ae43 100644 --- a/utils.c +++ b/utils.c @@ -357,6 +357,21 @@ write_defaults_uci(struct uci_context *ctx, struct fw3_defaults *d, uci_add_section(ctx, dest, "defaults", &ptr.s); + ptr.o = NULL; + ptr.option = "input"; + ptr.value = fw3_flag_names[d->policy_input]; + uci_set(ctx, &ptr); + + ptr.o = NULL; + ptr.option = "output"; + ptr.value = fw3_flag_names[d->policy_output]; + uci_set(ctx, &ptr); + + ptr.o = NULL; + ptr.option = "forward"; + ptr.value = fw3_flag_names[d->policy_forward]; + uci_set(ctx, &ptr); + sprintf(buf, "0x%x", d->flags[0]); ptr.o = NULL; ptr.option = "__flags_v4"; -- 2.25.1