From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo-Andres Hofmann To: development@lists.ipfire.org Subject: [PATCH v2 6/6] zoneconf.cgi: Improve VLAN & STP inputs Date: Thu, 18 Feb 2021 15:30:16 +0100 Message-ID: <20210218143016.972-6-hofmann@leo-andres.de> In-Reply-To: <20210218143016.972-1-hofmann@leo-andres.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2692651802473158786==" List-Id: --===============2692651802473158786== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Add default values and mark fields as required. Signed-off-by: Leo-Andres Hofmann --- html/cgi-bin/zoneconf.cgi | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/html/cgi-bin/zoneconf.cgi b/html/cgi-bin/zoneconf.cgi index 9d01d06ce..bbd042ffc 100644 --- a/html/cgi-bin/zoneconf.cgi +++ b/html/cgi-bin/zoneconf.cgi @@ -478,6 +478,9 @@ END if ($access_selected{"NONE"} eq "") { $highlight =3D $_; } + =09 + # default VLAN tag if not configured + $zone_vlan_id =3D 1 unless looks_like_number($zone_vlan_id); =20 print < @@ -486,7 +489,7 @@ END - + END ; @@ -513,6 +516,9 @@ foreach (@zones) { # load settings and prepare form eleme= nts for each zone my $stp_available =3D $ethsettings{"${uc}_MODE"} eq "bridge"; # STP is only= available in bridge mode my $stp_enabled =3D $ethsettings{"${uc}_STP"} eq "on"; my $stp_priority =3D $ethsettings{"${uc}_STP_PRIORITY"}; +=09 + # set priority to default value if no numerical value is configured + $stp_priority =3D 32768 unless looks_like_number($stp_priority); =20 # form element modifiers my $checked =3D ""; @@ -532,7 +538,7 @@ END # priority input box HTML my $row_2 =3D < - + END ; --=20 2.27.0.windows.1 --===============2692651802473158786==--