Commit 1f5ed9c6 authored by Antoine POPINEAU's avatar Antoine POPINEAU Committed by Brian May

Fix concatening string to tuple. Allow for forwarding a single port.

parent 6ec42adb
...@@ -40,8 +40,10 @@ class Method(BaseMethod): ...@@ -40,8 +40,10 @@ class Method(BaseMethod):
for _, swidth, sexclude, snet, fport, lport \ for _, swidth, sexclude, snet, fport, lport \
in sorted(subnets, key=subnet_weight, reverse=True): in sorted(subnets, key=subnet_weight, reverse=True):
tcp_ports = ('ip', 'protocol', 'tcp') tcp_ports = ('ip', 'protocol', 'tcp')
if fport: if fport and fport != lport:
tcp_ports = tcp_ports + ('dport { %d-%d }' % (fport, lport)) tcp_ports = tcp_ports + ('tcp', 'dport', '{ %d-%d }' % (fport, lport))
elif fport and fport == lport:
tcp_ports = tcp_ports + ('tcp', 'dport', '%d' % (fport))
if sexclude: if sexclude:
_nft('add rule', chain, *(tcp_ports + ( _nft('add rule', chain, *(tcp_ports + (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment