From be8890f615cbe4da185321dd138090dd28ca554d Mon Sep 17 00:00:00 2001 From: Kaarle Ritvanen Date: Thu, 18 Sep 2014 10:16:56 +0300 Subject: ConfigObject: inherit parent's label --- awall/model.lua | 5 +++++ awall/modules/filter.lua | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/awall/model.lua b/awall/model.lua index e6075cb..41e68ec 100644 --- a/awall/model.lua +++ b/awall/model.lua @@ -47,6 +47,11 @@ function M.ConfigObject:create(cls, params) self:error('Support for '..name..' objects not installed') end end + + if self.label then + params.label = self.label..(params.label and '-'..params.label or '') + end + return cls.morph(params, self.context, self.location) end diff --git a/awall/modules/filter.lua b/awall/modules/filter.lua index 527dfa3..d6cfd3a 100644 --- a/awall/modules/filter.lua +++ b/awall/modules/filter.lua @@ -121,7 +121,7 @@ function Filter:trules() local obj = self.extrarules[key] if not obj then - local params = {label=(self.label and self.label..'-' or '')..label} + local params = {label=label} for i, attr in ipairs( {'in', 'out', 'src', 'dest', 'dnat', 'ipset', 'ipsec', 'service'} ) do -- cgit v1.2.3