diff options
Diffstat (limited to 'modules/luci-mod-admin-full/luasrc/model')
-rw-r--r-- | modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/dhcp.lua | 9 | ||||
-rw-r--r-- | modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/hosts.lua | 9 |
2 files changed, 11 insertions, 7 deletions
diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/dhcp.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/dhcp.lua index 2acda0b73b..66d9942a11 100644 --- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/dhcp.lua +++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/dhcp.lua @@ -2,6 +2,7 @@ -- Licensed to the public under the Apache License 2.0. local ipc = require "luci.ip" +local sys = require "luci.sys" local o require "luci.util" @@ -311,10 +312,10 @@ end hostid = s:option(Value, "hostid", translate("<abbr title=\"Internet Protocol Version 6\">IPv6</abbr>-Suffix (hex)")) -ipc.neighbors({ family = 4 }, function(n) - if n.mac and n.dest then - ip:value(n.dest:string()) - mac:value(n.mac, "%s (%s)" %{ n.mac, n.dest:string() }) +sys.net.host_hints(function(m, v4, v6, name) + if m and v4 then + ip:value(v4) + mac:value(m, "%s (%s)" %{ m, name or v4 }) end end) diff --git a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/hosts.lua b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/hosts.lua index fafacf35c5..46945af58b 100644 --- a/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/hosts.lua +++ b/modules/luci-mod-admin-full/luasrc/model/cbi/admin_network/hosts.lua @@ -3,6 +3,7 @@ -- Licensed to the public under the Apache License 2.0. local ipc = require "luci.ip" +local sys = require "luci.sys" m = Map("dhcp", translate("Hostnames")) @@ -19,9 +20,11 @@ ip = s:option(Value, "ip", translate("IP address")) ip.datatype = "ipaddr" ip.rmempty = true -ipc.neighbors({ }, function(n) - if n.mac and n.dest and not n.dest:is6linklocal() then - ip:value(n.dest:string(), "%s (%s)" %{ n.dest:string(), n.mac }) +sys.net.host_hints(function(mac, v4, v6, name) + v6 = v6 and ipc.IPv6(v6) + + if v4 or (v6 and not v6:is6linklocal()) then + ip:value(tostring(v4 or v6), "%s (%s)" %{ tostring(v4 or v6), name or mac }) end end) |