luci-base: break circular luci.config <> luci.model.uci dependency
[project/luci.git] / modules / luci-base / luasrc / model / firewall.lua
index a9f6fdb..feff085 100644 (file)
@@ -1,21 +1,5 @@
---[[
-LuCI - Firewall model
-
-Copyright 2009 Jo-Philipp Wich <xm@subsignal.org>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-]]--
+-- Copyright 2009 Jo-Philipp Wich <jow@openwrt.org>
+-- Licensed to the public under the Apache License 2.0.
 
 local type, pairs, ipairs, table, luci, math
        = type, pairs, ipairs, table, luci, math
@@ -514,11 +498,13 @@ function forwarding.dest(self)
 end
 
 function forwarding.src_zone(self)
-       return zone(self:src())
+       local z = zone(self:src())
+       return z.sid and z
 end
 
 function forwarding.dest_zone(self)
-       return zone(self:dest())
+       local z = zone(self:dest())
+       return z.sid and z
 end