libs/core: fixes for luci.model.firewall, luci.model.network and luci.model.network...
[project/luci.git] / libs / core / luasrc / model / network.lua
index debf3db..e1e9f45 100644 (file)
@@ -217,7 +217,16 @@ function rename_network(self, old, new)
 end
 
 function get_interface(self, i)
-       return ifs[i] and interface(i)
+       if ifs[i] then
+               return interface(i)
+       else
+               local j
+               for j, _ in pairs(ifs) do
+                       if ifs[j].sid == i then
+                               return interface(j)
+                       end
+               end
+       end
 end
 
 function get_interfaces(self)