]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
zoneconf: Fix bug that resultet from last fix
authorFlorian Bührle <flo@erdlof.org>
Sat, 11 May 2019 12:38:39 +0000 (14:38 +0200)
committerFlorian Bührle <flo@erdlof.org>
Sat, 11 May 2019 12:38:39 +0000 (14:38 +0200)
Fix bug that prevents users from assigning NIC to RED if RED is in PPP
mode

html/cgi-bin/zoneconf.cgi

index adb3d29676e2181f89a51fdbc0791f972c543994..3712b92cdeb080fafcb07441764c5c02613b6f20 100644 (file)
@@ -166,10 +166,6 @@ if ($cgiparams{"ACTION"} eq $Lang::tr{"save"}) {
                my $VALIDATE_vlancount = 0;
                my $VALIDATE_zoneslaves = 0;
 
                my $VALIDATE_vlancount = 0;
                my $VALIDATE_zoneslaves = 0;
 
-               if ($zone_mode eq "") { # If this zone is not activated, we don't check it
-                       next;
-               }
-
                $ethsettings{"${uc}_MACADDR"} = "";
                $ethsettings{"${uc}_MODE"} = "";
                $ethsettings{"${uc}_SLAVES"} = "";
                $ethsettings{"${uc}_MACADDR"} = "";
                $ethsettings{"${uc}_MODE"} = "";
                $ethsettings{"${uc}_SLAVES"} = "";
@@ -203,13 +199,13 @@ if ($cgiparams{"ACTION"} eq $Lang::tr{"save"}) {
                        my $mac = $_->[0];
                        my $nic_access = $cgiparams{"ACCESS $uc $mac"};
 
                        my $mac = $_->[0];
                        my $nic_access = $cgiparams{"ACCESS $uc $mac"};
 
-                       if (! ($nic_access eq "NONE")) {
+                       if ($nic_access ne "NONE") {
                                if ($VALIDATE_nic_check{"RESTRICT $mac"}) { # If this interface is already assigned to RED in PPP mode, throw an error
                                        $VALIDATE_error = $Lang::tr{"zoneconf val ppp assignment error"};
                                        last;
                                }
 
                                if ($VALIDATE_nic_check{"RESTRICT $mac"}) { # If this interface is already assigned to RED in PPP mode, throw an error
                                        $VALIDATE_error = $Lang::tr{"zoneconf val ppp assignment error"};
                                        last;
                                }
 
-                               if ($zone_mode ne "BRIDGE" && $VALIDATE_zoneslaves > 0) {
+                               if ($zone_mode ne "BRIDGE" && $VALIDATE_zoneslaves > 0 && $nic_access ne "") {
                                        $VALIDATE_error = $Lang::tr{"zoneconf val zoneslave amount error"};
                                        last;
                                }
                                        $VALIDATE_error = $Lang::tr{"zoneconf val zoneslave amount error"};
                                        last;
                                }