dhcp.cgi: Fix incorrect { placement from patch 3724

Message ID 20210216133010.7645-1-adolf.belka@ipfire.org
State Accepted
Commit 896fa74d68e83b344235dbd147b0e429aafb14d3
Headers
Series dhcp.cgi: Fix incorrect { placement from patch 3724 |

Commit Message

Adolf Belka Feb. 16, 2021, 1:30 p.m. UTC
  - When patch 3724 was created for bug #10743 a curly bracket was placed in the wrong place
This results in the overlap of two if loops meaning that there will be no validity
check carried out on Default Lease Time if Deny Known Clients is not checked.
- This patch moves the { bracket to the right location.

Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
---
 html/cgi-bin/dhcp.cgi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Michael Tremer Feb. 16, 2021, 3:01 p.m. UTC | #1
Hello,

Is this something that needs to be pushed into master?

-Michael

> On 16 Feb 2021, at 13:30, Adolf Belka <adolf.belka@ipfire.org> wrote:
> 
> - When patch 3724 was created for bug #10743 a curly bracket was placed in the wrong place
> This results in the overlap of two if loops meaning that there will be no validity
> check carried out on Default Lease Time if Deny Known Clients is not checked.
> - This patch moves the { bracket to the right location.
> 
> Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
> ---
> html/cgi-bin/dhcp.cgi | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/html/cgi-bin/dhcp.cgi b/html/cgi-bin/dhcp.cgi
> index 2ebdde818..867614f2a 100644
> --- a/html/cgi-bin/dhcp.cgi
> +++ b/html/cgi-bin/dhcp.cgi
> @@ -180,12 +180,12 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'save'}) {
> 		if (($dhcpsettings{"START_ADDR_${itf}"}) eq '' && ($dhcpsettings{"END_ADDR_${itf}"}) eq '') {
> 			$errormessage = "DHCP on ${itf}: " . $Lang::tr{'dhcp valid range required when deny known clients checked'};
> 			goto ERROR;
> +		}
> 	    }
> 
> 	    if (!($dhcpsettings{"DEFAULT_LEASE_TIME_${itf}"} =~ /^\d+$/)) {
> 		$errormessage = "DHCP on ${itf}: " . $Lang::tr{'invalid default lease time'} . $dhcpsettings{'DEFAULT_LEASE_TIME_${itf}'};
> 		goto ERROR;
> -		}
> 	    }
> 
> 	    if (!($dhcpsettings{"MAX_LEASE_TIME_${itf}"} =~ /^\d+$/)) {
> -- 
> 2.30.1
>
  

Patch

diff --git a/html/cgi-bin/dhcp.cgi b/html/cgi-bin/dhcp.cgi
index 2ebdde818..867614f2a 100644
--- a/html/cgi-bin/dhcp.cgi
+++ b/html/cgi-bin/dhcp.cgi
@@ -180,12 +180,12 @@  if ($dhcpsettings{'ACTION'} eq $Lang::tr{'save'}) {
 		if (($dhcpsettings{"START_ADDR_${itf}"}) eq '' && ($dhcpsettings{"END_ADDR_${itf}"}) eq '') {
 			$errormessage = "DHCP on ${itf}: " . $Lang::tr{'dhcp valid range required when deny known clients checked'};
 			goto ERROR;
+		}
 	    }
 
 	    if (!($dhcpsettings{"DEFAULT_LEASE_TIME_${itf}"} =~ /^\d+$/)) {
 		$errormessage = "DHCP on ${itf}: " . $Lang::tr{'invalid default lease time'} . $dhcpsettings{'DEFAULT_LEASE_TIME_${itf}'};
 		goto ERROR;
-		}
 	    }
 
 	    if (!($dhcpsettings{"MAX_LEASE_TIME_${itf}"} =~ /^\d+$/)) {