libs/core: only consider enabled routes when finding wan interface
authorJo-Philipp Wich <jow@openwrt.org>
Fri, 29 Jun 2012 11:59:38 +0000 (11:59 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Fri, 29 Jun 2012 11:59:38 +0000 (11:59 +0000)
libs/core/luasrc/model/network.lua

index a0ff581..df6bf1e 100644 (file)
@@ -594,7 +594,7 @@ function get_status_by_route(self, addr, mask)
                        if s and s.route then
                                local rt
                                for _, rt in ipairs(s.route) do
-                                       if rt.target == addr and rt.mask == mask then
+                                       if rt.enabled and rt.target == addr and rt.mask == mask then
                                                return net, s
                                        end
                                end