Commit aa07b357 authored by Kaarle Ritvanen's avatar Kaarle Ritvanen

optimize chain selection for related rules (always ACCEPT)

parent ff5d7618
--[[
Filter module for Alpine Wall
Copyright (C) 2012-2013 Kaarle Ritvanen
Copyright (C) 2012-2014 Kaarle Ritvanen
See LICENSE file for license details
]]--
......@@ -36,6 +36,8 @@ function RelatedRule:servoptfrags()
return util.values(helpers)
end
function RelatedRule:target() return 'ACCEPT' end
local Filter = model.class(model.Rule)
......@@ -132,17 +134,13 @@ function Filter:trules()
if self.related then
for i, rule in listpairs(self.related) do
extrarules(
RelatedRule,
{service=self.service, action='accept'},
rule
)
extrarules(RelatedRule, {service=self.service}, rule)
end
else
-- TODO avoid creating unnecessary RELATED rules by introducing
-- helper direction attributes to service definitions
extrarules(RelatedRule, {action='accept'})
extrarules(RelatedRule, {reverse=true, action='accept'})
extrarules(RelatedRule)
extrarules(RelatedRule, {reverse=true})
end
if self['no-track'] then
......
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