From 35301280fcf4c1fa2d1e936ab19fabe8ef6210f2 Mon Sep 17 00:00:00 2001 From: Shaik Abdulla Date: Mon, 8 May 2023 17:41:56 +0530 Subject: [PATCH] correcting "logical operation" to determine the boolean value. This code corrects the logical operation to determine the boolean value, here it set to "False" when given value not in 0-255 range. Signed-off-by: Shaik Abdulla --- avocado/utils/network/interfaces.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/avocado/utils/network/interfaces.py b/avocado/utils/network/interfaces.py index 023691cba8..0f0eb536fa 100644 --- a/avocado/utils/network/interfaces.py +++ b/avocado/utils/network/interfaces.py @@ -766,7 +766,7 @@ def validate_ipv4_netmask_format(self, netmask): return False for octect in netmask_list: num = int(octect) - if 0 <= num <= 255: + if not 0 <= num <= 255: return False octet_bin = [format(int(i), "08b") for i in netmask_list] binary_netmask = ("").join(octet_bin)