From e839b9d18d4d67cefed0e5925199eeda38cb4b91 Mon Sep 17 00:00:00 2001 From: Konstantin Glukhov Date: Wed, 11 Mar 2026 15:16:30 +0900 Subject: [PATCH] luci-base: network.js: de-dup ifc IPv6 addresses De-dup IPv6 addresses before getIP6Addrs() returns an array from "ipv6-address" and "ipv6-prefix-assignment" ubus data. This can happen when the local address derived from a delegated prefix matches an explicitly configured IPv6 address. Use a Set to ensure that duplicate entries are filtered out before returning the address list. Signed-off-by: Konstantin Glukhov --- modules/luci-base/htdocs/luci-static/resources/network.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/luci-base/htdocs/luci-static/resources/network.js b/modules/luci-base/htdocs/luci-static/resources/network.js index 67ed3bf522..4d519b002a 100644 --- a/modules/luci-base/htdocs/luci-static/resources/network.js +++ b/modules/luci-base/htdocs/luci-static/resources/network.js @@ -2322,21 +2322,21 @@ Protocol = baseclass.extend(/** @lends LuCI.network.Protocol.prototype */ { */ getIP6Addrs() { let addrs = this._ubus('ipv6-address'); - const rv = []; + const rv = new Set(); if (Array.isArray(addrs)) for (let a of addrs) if (L.isObject(a)) - rv.push('%s/%d'.format(a.address, a.mask)); + rv.add('%s/%d'.format(a.address, a.mask)); addrs = this._ubus('ipv6-prefix-assignment'); if (Array.isArray(addrs)) for (let a of addrs) if (L.isObject(a) && L.isObject(a['local-address'])) - rv.push('%s/%d'.format(a['local-address'].address, a['local-address'].mask)); + rv.add('%s/%d'.format(a['local-address'].address, a['local-address'].mask)); - return rv; + return Array.from(rv); }, /**