local wan6 = ntm:get_wan6net()
local conn_count = tonumber(
- fs.readfile("/proc/sys/net/netfilter/nf_conntrack_count")) or 0
+ fs.readfile("/proc/sys/net/netfilter/nf_conntrack_count") or "") or 0
- local conn_max = tonumber((
- luci.sys.exec("sysctl net.nf_conntrack_max") or
- luci.sys.exec("sysctl net.ipv4.netfilter.ip_conntrack_max") or
- ""):match("%d+")) or 4096
+ local conn_max = tonumber(luci.sys.exec(
+ "sysctl -n -e net.nf_conntrack_max net.ipv4.netfilter.ip_conntrack_max"
+ ):match("%d+")) or 4096
local rv = {
uptime = sysinfo.uptime or 0,
return duid.substr(16).replace(/(..)(?=..)/g, '$1:').toUpperCase();
// DUID-LL / Ethernet
- if (duid.length === 24 && duid.substr(0, 8) === '00030001')
+ if (duid.length === 20 && duid.substr(0, 8) === '00030001')
return duid.substr(8).replace(/(..)(?=..)/g, '$1:').toUpperCase();
return null;
? '<div style="max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space: nowrap">? (%h)</div>'.format(host.name || host.ipv4 || host.ipv6)
: '?';
else
- tr.insertCell(-1).innerHTML = info.leases6[i].hostname;
+ tr.insertCell(-1).innerHTML =
+ (host && host.name && info.leases6[i].hostname != host.name)
+ ? '<div style="max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space: nowrap">%h (%h)</div>'.format(info.leases6[i].hostname, host.name)
+ : info.leases6[i].hostname;
tr.insertCell(-1).innerHTML = info.leases6[i].ip6addr;
tr.insertCell(-1).innerHTML = info.leases6[i].duid;