optionsfw.cgi: Add default settings for newly added options.
Commit Message
If no settings for those features can be obtained from the settings
file, set them to the following defaults.
* DROPSPOOFEDMARTIAN -> on (yes)
* DROPHOSTILE -> off (no - because only fresh installed systems should
do this)
* LOGDROPCTINVALID -> on (yes)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
---
html/cgi-bin/optionsfw.cgi | 9 +++++++++
1 file changed, 9 insertions(+)
Comments
Looks good to me.
Also, fixes: #12791
Reviewed-by: Peter Müller <peter.mueller@ipfire.org>
> If no settings for those features can be obtained from the settings
> file, set them to the following defaults.
>
> * DROPSPOOFEDMARTIAN -> on (yes)
> * DROPHOSTILE -> off (no - because only fresh installed systems should
> do this)
> * LOGDROPCTINVALID -> on (yes)
>
> Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
> ---
> html/cgi-bin/optionsfw.cgi | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/html/cgi-bin/optionsfw.cgi b/html/cgi-bin/optionsfw.cgi
> index 5611b71b7..fbff67b2f 100644
> --- a/html/cgi-bin/optionsfw.cgi
> +++ b/html/cgi-bin/optionsfw.cgi
> @@ -88,6 +88,15 @@ if (!$settings{'MASQUERADE_ORANGE'}) {
> if (!$settings{'MASQUERADE_BLUE'}) {
> $settings{'MASQUERADE_BLUE'} = 'on';
> }
> +if (!$settings{'DROPSPOOFEDMARTIAN'}) {
> + $settings{'DROPSPOOFEDMARTIAN'} = 'on';
> +}
> +if (!$settings{'DROPHOSTILE'}) {
> + $settings{'DROPHOSTILE'} = 'off';
> +}
> +if (!$settings{'LOGDROPCTINVALID'}) {
> + $settings{'LOGDROPCTINVALID'} = 'on';
> +}
>
> $checked{'DROPNEWNOTSYN'}{'off'} = '';
> $checked{'DROPNEWNOTSYN'}{'on'} = '';
@@ -88,6 +88,15 @@ if (!$settings{'MASQUERADE_ORANGE'}) {
if (!$settings{'MASQUERADE_BLUE'}) {
$settings{'MASQUERADE_BLUE'} = 'on';
}
+if (!$settings{'DROPSPOOFEDMARTIAN'}) {
+ $settings{'DROPSPOOFEDMARTIAN'} = 'on';
+}
+if (!$settings{'DROPHOSTILE'}) {
+ $settings{'DROPHOSTILE'} = 'off';
+}
+if (!$settings{'LOGDROPCTINVALID'}) {
+ $settings{'LOGDROPCTINVALID'} = 'on';
+}
$checked{'DROPNEWNOTSYN'}{'off'} = '';
$checked{'DROPNEWNOTSYN'}{'on'} = '';