diff --git a/amtscanner.js b/amtscanner.js index 0da5f5f7..1f414280 100644 --- a/amtscanner.js +++ b/amtscanner.js @@ -296,9 +296,9 @@ module.exports.CreateAmtScanner = function (parent) { //var provisioningStates = { 0: 'Pre', 1: 'in', 2: 'Post' }; //var provisioningStateStr = provisioningStates[provisioningState]; //console.log(rinfo.address + ': Intel AMT ' + majorVersion + '.' + minorVersion + ', ' + provisioningStateStr + '-Provisioning, Open Ports: [' + openPorts.join(', ') + ']'); - obj.dns.reverse(rinfo.address, function (err, hostname) { - if ((err != undefined) && (hostname != undefined)) { - user.results[rinfo.address] = { ver: majorVersion + '.' + minorVersion, tls: (((openPort == 16993) || (dualPorts == true)) ? 1 : 0), state: provisioningState, hostname: hostname[0] }; + obj.dns.reverse(rinfo.address, function (err, hostnames) { + if ((err == null) && (hostnames != null) && (hostnames.length > 0)) { + user.results[rinfo.address] = { ver: majorVersion + '.' + minorVersion, tls: (((openPort == 16993) || (dualPorts == true)) ? 1 : 0), state: provisioningState, hostname: hostnames[0] }; } else { user.results[rinfo.address] = { ver: majorVersion + '.' + minorVersion, tls: (((openPort == 16993) || (dualPorts == true)) ? 1 : 0), state: provisioningState, hostname: rinfo.address }; } diff --git a/views/default.handlebars b/views/default.handlebars index 0b0cb46f..6536ad1b 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -3535,7 +3535,7 @@ if (elements[i].checked) { var ipaddr = elements[i].getAttribute('tag'); var amtinfo = amtScanResults[ipaddr]; - meshserver.send({ action: 'addamtdevice', meshid: meshid, devicename: ipaddr, hostname: amtinfo.hostname, amtusername: '', amtpassword: '', amttls: amtinfo.tls }); + meshserver.send({ action: 'addamtdevice', meshid: meshid, devicename: amtinfo.hostname, hostname: amtinfo.hostname, amtusername: '', amtpassword: '', amttls: amtinfo.tls }); } } }