* Merged Luci to use native UCI-library
[project/luci.git] / applications / luci-fw / luasrc / model / cbi / luci_fw / portfw.lua
index e4f4fa2..79868af 100644 (file)
@@ -10,11 +10,12 @@ s.anonymous = true
 
 iface = s:option(ListValue, "iface", "Schnittstelle", "Externe Schnittstelle")
 iface.default = "wan"
-for k, v in pairs(luci.model.uci.sections("network")) do
-       if v[".type"] == "interface" and k ~= "loopback" then
-               iface:value(k)
-       end
-end
+luci.model.uci.foreach("network", "interface",
+       function (section)
+               if section[".name"] ~= "loopback" then
+                       iface:value(section[".name"])
+               end
+       end)
 
 proto = s:option(ListValue, "proto", "Protokoll")
 proto:value("tcp", "TCP")