summaryrefslogtreecommitdiffhomepage
path: root/libs/sys/luasrc
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-03-12 19:25:03 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-03-12 19:25:03 +0000
commit9836e949a58484a83d40a10570c3dab919770d6a (patch)
tree21fd8e18a46917c684b3ee79f79c1cd993097ffa /libs/sys/luasrc
parent945076c895cce30a862c68bd32205b74f30098cd (diff)
libs/sys: disregard ::/0 routes on "lo" in luci.sys.net.defaultroute6()
Diffstat (limited to 'libs/sys/luasrc')
-rw-r--r--libs/sys/luasrc/sys.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/sys/luasrc/sys.lua b/libs/sys/luasrc/sys.lua
index 8b05d44d8d..cc29fa37bb 100644
--- a/libs/sys/luasrc/sys.lua
+++ b/libs/sys/luasrc/sys.lua
@@ -302,7 +302,9 @@ function net.defaultroute6()
local route
net.routes6(function(rt)
- if rt.dest:prefix() == 0 and (not route or route.metric > rt.metric) then
+ if rt.dest:prefix() == 0 and rt.device ~= "lo" and
+ (not route or route.metric > rt.metric)
+ then
route = rt
end
end)