luci-mod-admin-full: don't replace DHCPv6 hostname
authorMathias Kresin <dev@kresin.me>
Thu, 16 Nov 2017 06:16:59 +0000 (07:16 +0100)
committerMathias Kresin <dev@kresin.me>
Fri, 17 Nov 2017 00:27:18 +0000 (01:27 +0100)
Don't replace the DHCPv6 supplied hostname if the DUID can be mapped to
the MAC-Address of an already known host.

It hides the issue of a missing DHCPv6 hostname and could lead to the
conclution that the already known host has an IPv6 address.

Signed-off-by: Mathias Kresin <dev@kresin.me>
modules/luci-mod-admin-full/luasrc/view/admin_network/lease_status.htm
modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm

index b4baedff28b772158b20e093712960dd9b7abc82..7e2cc090e439f5bf5818e78cdbd50390afcc64e0 100644 (file)
@@ -78,7 +78,7 @@
                                                tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);
 
                                        var host = hosts[duid2mac(st[1][i].duid)];
-                                       if (host)
+                                       if (!st[1][i].hostname && host)
                                                tr.insertCell(-1).innerHTML = String.format(
                                                        '<div style="max-width:200px;overflow:hidden;text-overflow:ellipsis">%s</div>',
                                                        ((host.name && (host.ipv4 || host.ipv6))
index d29a89427687738fca1b2493134ac8c01ecc8f9f..a46ee835c3b70df12cadb841fcae40010c858c78 100644 (file)
                                                tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);
 
                                        var host = hosts[duid2mac(info.leases6[i].duid)];
-                                       if (host)
+                                       if (!info.leases6[i].hostname && host)
                                                tr.insertCell(-1).innerHTML = String.format(
                                                        '<div style="max-width:200px;overflow:hidden;text-overflow:ellipsis">%s</div>',
                                                        ((host.name && (host.ipv4 || host.ipv6))