diff options
-rw-r--r-- | awall/model.lua | 4 | ||||
-rw-r--r-- | awall/object.lua | 7 |
2 files changed, 4 insertions, 7 deletions
diff --git a/awall/model.lua b/awall/model.lua index d0b6914..bc9bd28 100644 --- a/awall/model.lua +++ b/awall/model.lua @@ -298,8 +298,8 @@ function Rule:trules() setfamilies(res) tag(res, 'chain', self:chain()) - local addrofrags = combinations(Zone.new({addr=self.src}):optfrags('in'), - Zone.new({addr=self.dest}):optfrags('out')) + local addrofrags = combinations(Zone.morph({addr=self.src}):optfrags('in'), + Zone.morph({addr=self.dest}):optfrags('out')) if addrofrags then addrofrags = ffilter(addrofrags) diff --git a/awall/object.lua b/awall/object.lua index 23ee081..a49e96c 100644 --- a/awall/object.lua +++ b/awall/object.lua @@ -13,15 +13,12 @@ function class(base) if base then setmetatable(cls, {__index = base}) end - function cls.new(...) - local inst = arg[1] and arg[1] or {} - cls.morph(inst) - return inst - end + function cls.new(...) return cls.morph({}, unpack(arg)) end function cls:morph(...) setmetatable(self, mt) self:init(unpack(arg)) + return self end return cls |