Record default policies in state file
authorJo-Philipp Wich <jow@openwrt.org>
Tue, 30 Apr 2013 19:33:37 +0000 (21:33 +0200)
committerJo-Philipp Wich <jow@openwrt.org>
Tue, 30 Apr 2013 19:33:37 +0000 (21:33 +0200)
utils.c

diff --git a/utils.c b/utils.c
index a728e77b3fde6a3d064d0f4741b06238540d9fe6..409ae43d2674d3012956610f77add3836d22b423 100644 (file)
--- 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";