mirror of
https://github.com/fail2ban/fail2ban.git
synced 2026-08-04 06:39:05 +00:00
- Fixed a bug in DNSUtils
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@284 a942ae1a-1317-0410-a47c-b1dcaea8d605
This commit is contained in:
parent
ca5b70cd24
commit
1fd2071cd8
1 changed files with 7 additions and 7 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue