- Fixed a bug in DNSUtils

git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@284 a942ae1a-1317-0410-a47c-b1dcaea8d605
0.x
Cyril Jaquier 2006-08-20 22:54:05 +00:00
parent ca5b70cd24
commit 1fd2071cd8
1 changed files with 7 additions and 7 deletions

View File

@ -497,7 +497,6 @@ class DNSUtils:
""" Search if an IP address if directly available and return
it.
"""
print DNSUtils.ipCRE
match = DNSUtils.ipCRE.match(text)
if match:
return match
@ -523,14 +522,15 @@ class DNSUtils:
# Search for plain IP
plainIP = DNSUtils.searchIP(text)
if not plainIP == None:
if isValidIP(element):
ipList.append(element)
plainIPStr = plainIP.group(0)
if DNSUtils.isValidIP(plainIPStr):
ipList.append(plainIPStr)
if not ipList:
# Try to get IP from possible DNS
dnsList = DNSUtils.textToDns(text)
if not dnsList == None:
dns = DNSUtils.dnsToIp(element)
for e in dns:
dns = DNSUtils.textToDns(text)
if not dns == None:
ip = DNSUtils.dnsToIp(dns.group(0))
for e in ip:
ipList.append(e)
return ipList