python-iptables icon indicating copy to clipboard operation
python-iptables copied to clipboard

Segfault on None or 'None' for dport extension

Open Willyou2 opened this issue 1 year ago • 0 comments

Running python 3.12, python-iptables v1.01, iptables v1.8.4 (legacy) on ubuntu 20.04

Since update from py 3.11 to 3.12, passing a rule_d to add_rule in iptc.easy.add_rule() with rule_d['tcp'] = {'dport': None} or rule_d['tcp'] = {'dport': 'None'} throws segfault

example:

rule_d = {'target': 'REJECT', 'src': '1.1.1.1', 'protocol': 'tcp', 'tcp': {'dport': 'None'}} 
add_rule('filter', 'SOME_CHAIN', rule_d, 0)
>>> Segmentation fault (core dumped)

Willyou2 avatar May 23 '24 20:05 Willyou2