luci-app-olsr: add workaround for finding default gw with policy routing
authorJo-Philipp Wich <jow@openwrt.org>
Fri, 16 Jan 2015 20:10:32 +0000 (21:10 +0100)
committerJo-Philipp Wich <jow@openwrt.org>
Fri, 16 Jan 2015 20:40:49 +0000 (21:40 +0100)
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
applications/luci-app-olsr/luasrc/controller/olsr.lua

index 4573f69..3615372 100644 (file)
@@ -115,6 +115,10 @@ function action_neigh(json)
                end
        end)
 
+       if not defaultgw then
+               defaultgw = luci.util.exec("ip route list exact 0.0.0.0/0 table all"):match(" via (%S+)")
+       end
+
        local function compare(a,b)
                if a.proto == b.proto then
                        return a.linkCost < b.linkCost