diff options
author | Jo-Philipp Wich <jo@mein.io> | 2019-09-18 07:46:33 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2019-09-18 07:46:33 +0200 |
commit | fd9182b21a84bbdb15474fe9473fa9b0fbfd300f (patch) | |
tree | f65e234a7fedb073100e393d9919ee9b5226ce70 /modules/luci-base/htdocs/luci-static | |
parent | 15cc74c6b444d22ccfc4384465424edd6d3a718e (diff) |
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 <jo@mein.io>
Diffstat (limited to 'modules/luci-base/htdocs/luci-static')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/network.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/network.js b/modules/luci-base/htdocs/luci-static/resources/network.js index c3c20304e5..d0282ad01f 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); |