mirror of https://github.com/fail2ban/fail2ban
- Fixed a bug in DNSUtils
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@284 a942ae1a-1317-0410-a47c-b1dcaea8d6050.x
parent
ca5b70cd24
commit
1fd2071cd8
|
@ -497,7 +497,6 @@ class DNSUtils:
|
||||||
""" Search if an IP address if directly available and return
|
""" Search if an IP address if directly available and return
|
||||||
it.
|
it.
|
||||||
"""
|
"""
|
||||||
print DNSUtils.ipCRE
|
|
||||||
match = DNSUtils.ipCRE.match(text)
|
match = DNSUtils.ipCRE.match(text)
|
||||||
if match:
|
if match:
|
||||||
return match
|
return match
|
||||||
|
@ -523,14 +522,15 @@ class DNSUtils:
|
||||||
# Search for plain IP
|
# Search for plain IP
|
||||||
plainIP = DNSUtils.searchIP(text)
|
plainIP = DNSUtils.searchIP(text)
|
||||||
if not plainIP == None:
|
if not plainIP == None:
|
||||||
if isValidIP(element):
|
plainIPStr = plainIP.group(0)
|
||||||
ipList.append(element)
|
if DNSUtils.isValidIP(plainIPStr):
|
||||||
|
ipList.append(plainIPStr)
|
||||||
if not ipList:
|
if not ipList:
|
||||||
# Try to get IP from possible DNS
|
# Try to get IP from possible DNS
|
||||||
dnsList = DNSUtils.textToDns(text)
|
dns = DNSUtils.textToDns(text)
|
||||||
if not dnsList == None:
|
if not dns == None:
|
||||||
dns = DNSUtils.dnsToIp(element)
|
ip = DNSUtils.dnsToIp(dns.group(0))
|
||||||
for e in dns:
|
for e in ip:
|
||||||
ipList.append(e)
|
ipList.append(e)
|
||||||
return ipList
|
return ipList
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue