diff options
| author | Stijn Tintel | 2021-11-25 04:01:51 +0000 |
|---|---|---|
| committer | Stijn Tintel | 2022-01-06 12:51:44 +0000 |
| commit | 334a127df426286101f90c4f9ec79f8b64d59f14 (patch) | |
| tree | 74cf26bfe99a18c02dbac090f27a159f77eb1f2d | |
| parent | 31c7550efcb8d1f6014202a257fc1b9e3ab5fc9e (diff) | |
| download | firewall4-334a127df426286101f90c4f9ec79f8b64d59f14.tar.gz | |
fw4.uc: introduce DEPRECATED flag
When a section contains unknown options, the parse_options function will
return false, and based on that the entire section might be skipped.
For example, rules containing a _name option will be skipped. As this
option used to be added by LuCI in the past, we should not skip those
rules, as it might break existing configs for many users.
Add a new DEPRECATED flag to handle such options.
Suggested-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Reviewed-by: Jo-Philipp Wich <jo@mein.io>
| -rw-r--r-- | root/usr/share/ucode/fw4.uc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/root/usr/share/ucode/fw4.uc b/root/usr/share/ucode/fw4.uc index 8057fac..df5ab87 100644 --- a/root/usr/share/ucode/fw4.uc +++ b/root/usr/share/ucode/fw4.uc @@ -11,6 +11,7 @@ let FLATTEN_LIST = 0x02; let NO_INVERT = 0x04; let UNSUPPORTED = 0x08; let REQUIRED = 0x10; +let DEPRECATED = 0x20; let ipv4_icmptypes = { "any": [ 0xFF, 0, 0xFF ], @@ -622,7 +623,9 @@ return { } if (res != null) { - if (flags & UNSUPPORTED) + if (flags & DEPRECATED) + this.warn_section(s, "option '" + key + "' is deprecated by fw4"); + else if (flags & UNSUPPORTED) this.warn_section(s, "option '" + key + "' is not supported by fw4"); else rv[key] = res; |