-
Notifications
You must be signed in to change notification settings - Fork 185
Description
There seems to be an issue storing the --random parameter in the list of parameters of an SNAT target:
import iptc
table = iptc.Table("nat")
rule = iptc.Rule()
target = rule.create_target("SNAT")
target.random = ""
target.to_source = "10.10.101.254"
target.get_all_parameters()
{'to-source': ['10.10.101.254']}
iptc.easy.decode_iptc_rule(rule)
{'target': {'SNAT': {'to-source': '10.10.101.254'}}, 'counters': (0, 0)}
or via encoding a rule by using a dict and then decoding it again:
rule_dict = {'src': '10.10.121.254/32', 'target': {'SNAT': {'to-source': '10.10.101.254', 'random': ''}}, 'counters': (0, 0)}
rule = iptc.easy.encode_iptc_rule(rule_dict)
iptc.easy.decode_iptc_rule(rule)
{'src': '10.10.121.254/32', 'target': {'SNAT': {'to-source': '10.10.101.254'}}, 'counters': (0, 0)}
Am I missing something or is this indeed a bug?