From bbfc6595e32d20301cf2d268f286dd86ba05b861 Mon Sep 17 00:00:00 2001 From: gSpot Date: Sun, 8 May 2022 21:18:31 +0300 Subject: [PATCH] ruantiblock-mod-lua, ruantiblock-mod-py: fixes --- .../files/usr/libexec/ruantiblock/ruab_parser.lua | 2 +- ruantiblock-mod-py/files/usr/libexec/ruantiblock/ruab_parser.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ruantiblock-mod-lua/files/usr/libexec/ruantiblock/ruab_parser.lua b/ruantiblock-mod-lua/files/usr/libexec/ruantiblock/ruab_parser.lua index 392361e..dfd014d 100755 --- a/ruantiblock-mod-lua/files/usr/libexec/ruantiblock/ruab_parser.lua +++ b/ruantiblock-mod-lua/files/usr/libexec/ruantiblock/ruab_parser.lua @@ -278,7 +278,7 @@ function BlackListParser:fill_ip_tables(val) if not self.BLLIST_IP_FILTER or (self.BLLIST_IP_FILTER and not self:check_filter(ip_entry, self.BLLIST_IP_FILTER_PATTERNS)) then if ip_entry:match("^" .. self.ip_pattern .. "$") and not self.ip_table[ip_entry] then local subnet = self:get_subnet(ip_entry) - if subnet and (self.BLLIST_GR_EXCLUDED_NETS[subnet] or ((not self.BLLIST_IP_LIMIT or self.BLLIST_IP_LIMIT == 0) or (not self.ip_subnet_table[subnet] or self.ip_subnet_table[subnet] < self.BLLIST_IP_LIMIT))) then + if subnet and (self.BLLIST_GR_EXCLUDED_NETS[subnet] or ((not self.BLLIST_IP_LIMIT or self.BLLIST_IP_LIMIT == 0) or (not self.ip_subnet_table[subnet] or self.ip_subnet_table[subnet] <= self.BLLIST_IP_LIMIT))) then self.ip_table[ip_entry] = subnet self.ip_subnet_table[subnet] = (self.ip_subnet_table[subnet] or 0) + 1 self.ip_count = self.ip_count + 1 diff --git a/ruantiblock-mod-py/files/usr/libexec/ruantiblock/ruab_parser.py b/ruantiblock-mod-py/files/usr/libexec/ruantiblock/ruab_parser.py index 3b0c7f9..065a058 100755 --- a/ruantiblock-mod-py/files/usr/libexec/ruantiblock/ruab_parser.py +++ b/ruantiblock-mod-py/files/usr/libexec/ruantiblock/ruab_parser.py @@ -253,7 +253,7 @@ class BlackListParser(Config): subnet = self._get_subnet(i) if subnet in self.BLLIST_GR_EXCLUDED_NETS or ( not self.BLLIST_IP_LIMIT or ( - subnet not in self.ip_subnet_dict or self.ip_subnet_dict[subnet] < self.BLLIST_IP_LIMIT + subnet not in self.ip_subnet_dict or self.ip_subnet_dict[subnet] <= self.BLLIST_IP_LIMIT ) ): self.ip_set[i] = subnet