diff options
Diffstat (limited to 'filter.patch')
-rw-r--r-- | filter.patch | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/filter.patch b/filter.patch new file mode 100644 index 000000000000..bfee65b963a0 --- /dev/null +++ b/filter.patch @@ -0,0 +1,38 @@ +# Fail2Ban IPv6 Patch for Fail2Ban v0.9.3, v0.9.4, v0.9.5 +--- filter.py.orig ++++ filter.py +@@ -849,6 +849,7 @@ + class DNSUtils: + + IP_CRE = re.compile("^(?:\d{1,3}\.){3}\d{1,3}$") ++ IP_CRE6 = re.compile("^(?:[0-9:A-Fa-f]{3,})$") + + @staticmethod + def dnsToIp(dns): +@@ -883,19 +884,21 @@ + if match: + return match + else: +- return None ++ match = DNSUtils.IP_CRE6.match(text) ++ if match: ++ """ Right Here, we faced to a ipv6 ++ """ ++ return match ++ else: ++ return None + + @staticmethod + def isValidIP(string): + """ Return true if str is a valid IP ++ We Consider that logfiles didn't make errors ;) + """ +- s = string.split('/', 1) +- try: +- socket.inet_aton(s[0]) +- return True +- except socket.error: +- return False ++ return True + + @staticmethod |