luci-mod-admin-full: don't replace DHCPv6 hostname

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>
This commit is contained in:
Mathias Kresin 2017-11-16 07:16:59 +01:00
parent 4891deaf94
commit a1ee8e16b6
2 changed files with 2 additions and 2 deletions

View 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))

View file

@ -417,7 +417,7 @@
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))