Skip to content

Commit

Permalink
allow trailing 0 in host ip address.
Browse files Browse the repository at this point in the history
  • Loading branch information
HappyBasher committed Sep 1, 2023
1 parent 1a67fcd commit 1570f07
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# functions.py
#
# thomas@linuxmuster.net
# 20220603
# 20230831
#

from subprocess import Popen, PIPE
Expand Down Expand Up @@ -904,7 +904,7 @@ def isValidHostIpv4(ip):
if not ipv4.version() == 4:
return False
ipv4str = IP(ipv4).strNormal(0)
if (int(ipv4str.split('.')[0]) == 0 or int(ipv4str.split('.')[3]) == 0):
if (int(ipv4str.split('.')[0]) == 0):
return False
c = 0
for i in ipv4str.split('.'):
Expand Down

0 comments on commit 1570f07

Please sign in to comment.