Handle UnicodeError in firewall when resolving hostname

This commit is contained in:
icequbes1 2021-01-02 15:29:58 -08:00
父節點 ba4e7f853d
當前提交 ed33374f67
沒有發現已知的金鑰在資料庫的簽署中
GPG Key ID: 8CDFE284B142D0EA

查看文件

@ -619,6 +619,9 @@ class NftablesWorker(FirewallWorker):
except socket.gaierror as e:
raise RuleParseError('Failed to resolve {}: {}'.format(
rule['dsthost'], str(e)))
except UnicodeError as e:
raise RuleParseError('Invalid destination {}: {}'.format(
rule['dsthost'], str(e)))
nft_rule += ' {} daddr {{ {} }}'.format(ip_match,
', '.join(set(item[4][0] + fullmask for item in addrinfo)))