summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2013-01-24 14:32:19 +0000
committerKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2013-01-24 14:32:19 +0000
commitdd0c72982ec21a31197ae031f9130c7579460089 (patch)
treee15af2e60e3447eb49a9cb9e1c25e3ca95563cbe
parentf668c1eb097e24750b1be1cd2bbd1a91df5e9b43 (diff)
downloadawall-dd0c72982ec21a31197ae031f9130c7579460089.tar.bz2
awall-dd0c72982ec21a31197ae031f9130c7579460089.tar.xz
make to-port attribute optional in tproxy rules
-rw-r--r--awall/modules/tproxy.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/awall/modules/tproxy.lua b/awall/modules/tproxy.lua
index f2931b2..af6522f 100644
--- a/awall/modules/tproxy.lua
+++ b/awall/modules/tproxy.lua
@@ -16,8 +16,8 @@ local MarkRule = require('awall').loadclass('mark')
local TProxyRule = class(MarkRule)
function TProxyRule:target()
- if not self['to-port'] then self:error('Proxy port not specified') end
- return 'TPROXY --tproxy-mark '..self.mark..' --on-port '..self['to-port']
+ local port = self['to-port'] or 0
+ return 'TPROXY --tproxy-mark '..self.mark..' --on-port '..port
end
function TProxyRule:mangleoptfrag(ofrag)