libs/core: fixes for luci.model.firewall, luci.model.network and luci.model.network...
[project/luci.git] / libs / core / luasrc / model / network.lua
index debf3dba49d0d1cdc629f5080fa2347f28d72879..e1e9f4558c2d3a049406cc0862e69f37ce22c518 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)