From: Jo-Philipp Wich Date: Wed, 18 Sep 2019 05:46:33 +0000 (+0200) Subject: luci-base: network.js: filter invalid mac addresses X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=fd9182b21a84bbdb15474fe9473fa9b0fbfd300f;p=oweals%2Fluci.git 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 --- 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);