* luci/olsr: fix names of interfaces with type bridge
[project/luci.git] / applications / luci-olsr / luasrc / model / cbi / olsr / olsrd.lua
index b89fb25..8bad520 100644 (file)
@@ -65,7 +65,11 @@ network:value("")
 luci.model.uci.foreach("network", "interface",
        function (section)
                if section[".name"] ~= "loopback" then
-                       network:value(section[".name"])
+                       if section.type and section.type == "bridge" then
+                               network:value("br-"..section[".name"],section[".name"])
+                       else
+                               network:value(section[".name"])
+                       end
                end
        end)
 
@@ -91,4 +95,26 @@ for k, v in pairs(luci.fs.dir("/usr/lib")) do
        end
 end
 
-return m
\ No newline at end of file
+
+for i, sect in ipairs({ "Hna4", "Hna6" }) do
+       hna = m:section(TypedSection, sect)
+       hna.addremove = true
+       hna.anonymous = true
+
+       net = hna:option(Value, "NetAddr")
+       msk = hna:option(Value, "Prefix")
+end
+
+
+ipc = m:section(NamedSection, "IpcConnect")
+conns = ipc:option(Value, "MaxConnections")
+conns.isInteger = true
+
+nets  = ipc:option(Value, "Net")
+nets.optional = true
+
+hosts = ipc:option(Value, "Host")
+hosts.optional = true
+
+
+return m