summaryrefslogtreecommitdiffhomepage
path: root/applications
diff options
context:
space:
mode:
authorManuel Munz <freifunk@somakoma.de>2011-01-02 16:20:25 +0000
committerManuel Munz <freifunk@somakoma.de>2011-01-02 16:20:25 +0000
commitd9736ece54d502709a06b759bcdbebe9af56b4ef (patch)
tree01752f532f05fe4519de487a0bb1c75de40d27e2 /applications
parentd3d750b6503322482cd638528b13ccc87dc41602 (diff)
applications/luci-olsr: Save RAM while getting the default route, very good hint from jow :)
Diffstat (limited to 'applications')
-rw-r--r--applications/luci-olsr/luasrc/controller/olsr.lua6
1 files changed, 1 insertions, 5 deletions
diff --git a/applications/luci-olsr/luasrc/controller/olsr.lua b/applications/luci-olsr/luasrc/controller/olsr.lua
index 688e4918d..f4d52c42d 100644
--- a/applications/luci-olsr/luasrc/controller/olsr.lua
+++ b/applications/luci-olsr/luasrc/controller/olsr.lua
@@ -240,11 +240,7 @@ function fetch_txtinfo(otable)
if otable == "links" then
local route = {}
- for i, route in ipairs(luci.sys.net.routes()) do
- if route.dest:prefix() == 0 then
- defaultgw = route.gateway:string()
- end
- end
+ luci.sys.net.routes(function(r) if r.dest:prefix() == 0 then defaultgw = r.gateway:string() end end)
end
for i, tbl in ipairs(tables) do