From: Jo-Philipp Wich Date: Tue, 30 Apr 2013 19:33:37 +0000 (+0200) Subject: Record default policies in state file X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9d6200d6e3c41dce0fbbbb1a212c027a96f7be14;p=oweals%2Ffirewall3.git Record default policies in state file --- 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";