modules: iptables: correctly parse --nfmask/--ctmask

`iptables-save` can return rules like this one:

```
-A PREROUTING -m connmark ! --mark 0x0/0xffff0000 -j CONNMARK \
--restore-mark --nfmask 0xffff0000 --ctmask 0xffff0000
```

which leads to the following behavior:

```
$ salt '*' iptables.get_rules
minion:
    Minion did not return. [No response]
```

This commit fixes the behavior of `iptables.get_rules` in this case,
which also fixes the `iptables.append` state when such a rule already
exists on the minion.
This commit is contained in:
Benoît Knecht 2017-08-23 16:40:11 +02:00
parent 6adc03e4b4
commit 3c1ddc9bde

View file

@ -1455,6 +1455,8 @@ def _parser():
add_arg('--or-mark', dest='or-mark', action='append')
add_arg('--xor-mark', dest='xor-mark', action='append')
add_arg('--set-mark', dest='set-mark', action='append')
add_arg('--nfmask', dest='nfmask', action='append')
add_arg('--ctmask', dest='ctmask', action='append')
## CONNSECMARK
add_arg('--save', dest='save', action='append')
add_arg('--restore', dest='restore', action='append')