diff --git a/data/Dockerfiles/netfilter/modules/Logger.py b/data/Dockerfiles/netfilter/modules/Logger.py index 25562965f6..0ba2f42adc 100644 --- a/data/Dockerfiles/netfilter/modules/Logger.py +++ b/data/Dockerfiles/netfilter/modules/Logger.py @@ -13,9 +13,12 @@ def log(self, priority, message): tolog['time'] = int(round(time.time())) tolog['priority'] = priority tolog['message'] = message - if self.r is not None: - self.r.lpush('NETFILTER_LOG', json.dumps(tolog, ensure_ascii=False)) print(message) + if self.r is not None: + try: + self.r.lpush('NETFILTER_LOG', json.dumps(tolog, ensure_ascii=False)) + except Exception as ex: + print('Failed logging to redis: %s' % (ex)) def logWarn(self, message): self.log('warn', message) diff --git a/data/Dockerfiles/netfilter/modules/NFTables.py b/data/Dockerfiles/netfilter/modules/NFTables.py index 4cb0110aea..7740fa59f8 100644 --- a/data/Dockerfiles/netfilter/modules/NFTables.py +++ b/data/Dockerfiles/netfilter/modules/NFTables.py @@ -452,6 +452,8 @@ def get_unban_ip_dict(self, ipaddr:str, _family: str): continue rule = _object["rule"]["expr"][0]["match"] + if not "payload" in rule["left"]: + continue left_opt = rule["left"]["payload"] if not left_opt["protocol"] == _family: continue diff --git a/docker-compose.yml b/docker-compose.yml index bd06e265b0..ea56b4291e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -441,7 +441,7 @@ services: - acme netfilter-mailcow: - image: mailcow/netfilter:1.57 + image: mailcow/netfilter:1.58 stop_grace_period: 30s restart: always privileged: true