From fd9182b21a84bbdb15474fe9473fa9b0fbfd300f Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 18 Sep 2019 07:46:33 +0200 Subject: [PATCH] luci-base: network.js: filter invalid mac addresses Only consider valid ethernet mac addresses when building the device state from raw getifaddrs() information. Signed-off-by: Jo-Philipp Wich --- modules/luci-base/htdocs/luci-static/resources/network.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/luci-base/htdocs/luci-static/resources/network.js b/modules/luci-base/htdocs/luci-static/resources/network.js index c3c20304e..d0282ad01 100644 --- a/modules/luci-base/htdocs/luci-static/resources/network.js +++ b/modules/luci-base/htdocs/luci-static/resources/network.js @@ -463,7 +463,9 @@ function initNetworkState(refresh) { if (a.family == 'packet') { s.netdevs[name].flags = a.flags; s.netdevs[name].stats = a.data; - s.netdevs[name].macaddr = a.addr; + + if (a.addr != null && a.addr != '00:00:00:00:00:00' && a.addr.length == 17) + s.netdevs[name].macaddr = a.addr; } else if (a.family == 'inet') { s.netdevs[name].ipaddrs.push(a.addr + '/' + a.netmask); -- 2.25.1