From 3ffc59b8867a96cff6e478d2e496efd5dd97bb66 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 24 Dec 2023 06:06:08 +0200 Subject: [PATCH] disable undefined ipfilter construction --- pymaster.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pymaster.py b/pymaster.py index 949823c..99ff59b 100755 --- a/pymaster.py +++ b/pymaster.py @@ -12,7 +12,7 @@ from ipaddress import ip_address, ip_network from server_entry import ServerEntry from protocol import MasterProtocol -import ipfilter +# import ipfilter LOG_FILENAME = 'pymaster.log' MAX_SERVERS_FOR_IP = 14 @@ -66,7 +66,7 @@ class PyMaster: self.serverList = [] self.serverRL = IPRateLimit('server', 60, 30) self.clientRL = IPRateLimit('client', 60, 120) - self.ipfilterRL = IPRateLimit('filterlog', 60, 10) + # self.ipfilterRL = IPRateLimit('filterlog', 60, 10) self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) self.sock.bind((ip, port)) @@ -77,10 +77,10 @@ class PyMaster: def serverLoop(self): data, addr = self.sock.recvfrom(1024) - if ip_address(addr[0]) in ipfilter.ipfilter: - if not self.ipfilterRL.ratelimit(addr[0]): - log('Filter: %s:%d' % (addr[0], addr[1])) - return + # if ip_address(addr[0]) in ipfilter.ipfilter: + # if not self.ipfilterRL.ratelimit(addr[0]): + # log('Filter: %s:%d' % (addr[0], addr[1])) + # return if len(data) == 0: return