luci-mod-network: interfaces.js: derive status from layer 3 device
authorJo-Philipp Wich <jo@mein.io>
Wed, 18 Sep 2019 05:33:25 +0000 (07:33 +0200)
committerJo-Philipp Wich <jo@mein.io>
Wed, 18 Sep 2019 05:33:25 +0000 (07:33 +0200)
Align the status column device selection logic with the approach used for
rendering the interface status boxes; first try to obtain the active
layer3 device as reported by ubus, only then fall back to the protocol
specific device hint which might or might not point to an existing device.

Fixes: #3076
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js

index c79deea27adcd0aa6eda511466863ee8f838edb1..624718dd84eacdd34a6f4a4e3e0f8e33345a3af7 100644 (file)
@@ -65,7 +65,7 @@ function render_status(node, ifc, with_device) {
            ipaddrs = changecount ? [] : ifc.getIPAddrs(),
            ip6addrs = changecount ? [] : ifc.getIP6Addrs(),
            errors = ifc.getErrors(),
-           maindev = ifc.getDevice(),
+           maindev = ifc.getL3Device() || ifc.getDevice(),
            macaddr = maindev ? maindev.getMAC() : null;
 
        return L.itemlist(node, [