Fix iptables TypeError if state/match/ctstate missing

Completely untested...

Fixes #22465
This commit is contained in:
Adrian Likins 2017-03-10 15:28:52 -05:00 committed by Brian Coca
parent 06bcff8d92
commit 3af6ad1687

View file

@ -406,8 +406,6 @@ def construct_rule(params):
elif params['ctstate']: elif params['ctstate']:
append_match(rule, params['ctstate'], 'conntrack') append_match(rule, params['ctstate'], 'conntrack')
append_csv(rule, params['ctstate'], '--ctstate') append_csv(rule, params['ctstate'], '--ctstate')
else:
return False
append_match(rule, params['limit'] or params['limit_burst'], 'limit') append_match(rule, params['limit'] or params['limit_burst'], 'limit')
append_param(rule, params['limit'], '--limit', False) append_param(rule, params['limit'], '--limit', False)
append_param(rule, params['limit_burst'], '--limit-burst', False) append_param(rule, params['limit_burst'], '--limit-burst', False)