Do not use DNSSuffixes from windows

This commit is contained in:
ricardopolo 2019-11-01 10:12:33 -05:00
parent 73a2ad62b1
commit f32233fee8

View File

@ -193,12 +193,6 @@ function parseLinesWindowsNics(sections, nconfigsections) {
let lines = sections[i].trim().split('\r\n'); let lines = sections[i].trim().split('\r\n');
let linesNicConfig = nconfigsections[i].trim().split('\r\n'); let linesNicConfig = nconfigsections[i].trim().split('\r\n');
let netEnabled = util.getValue(lines, 'NetEnabled', '='); let netEnabled = util.getValue(lines, 'NetEnabled', '=');
let dnsSuffixes = util.getValue(linesNicConfig, 'DNSDomainSuffixSearchOrder', '=').replace(/{|}/g, '');
if(dnsSuffixes !== '') {
dnsSuffixes = dnsSuffixes.replace(/;/g, ',');
dnsSuffixes = dnsSuffixes.replace(/"/g, '');
dnsSuffixes = dnsSuffixes.split(",");
}
if (netEnabled) { if (netEnabled) {
const speed = parseInt(util.getValue(lines, 'speed', '=').trim(), 10) / 1000000; const speed = parseInt(util.getValue(lines, 'speed', '=').trim(), 10) / 1000000;
@ -206,7 +200,6 @@ function parseLinesWindowsNics(sections, nconfigsections) {
mac: util.getValue(lines, 'MACAddress', '=').toLowerCase(), mac: util.getValue(lines, 'MACAddress', '=').toLowerCase(),
dhcp: util.getValue(linesNicConfig, 'dhcpEnabled', '=').toLowerCase(), dhcp: util.getValue(linesNicConfig, 'dhcpEnabled', '=').toLowerCase(),
name: util.getValue(lines, 'Name', '=').replace(/\]/g, ')').replace(/\[/g, '('), name: util.getValue(lines, 'Name', '=').replace(/\]/g, ')').replace(/\[/g, '('),
dnsSuffixes: dnsSuffixes === '' ? [] : dnsSuffixes,
netEnabled: netEnabled === 'TRUE', netEnabled: netEnabled === 'TRUE',
speed: isNaN(speed) ? -1 : speed, speed: isNaN(speed) ? -1 : speed,
operstate: util.getValue(lines, 'NetConnectionStatus', '=') === '2' ? 'up' : 'down', operstate: util.getValue(lines, 'NetConnectionStatus', '=') === '2' ? 'up' : 'down',
@ -413,7 +406,6 @@ function networkInterfaces(callback) {
let carrierChanges = 0; let carrierChanges = 0;
let operstate = 'down'; let operstate = 'down';
let dhcp = false; let dhcp = false;
let dnsSuffixes = [];
let type = ''; let type = '';
if (ifaces.hasOwnProperty(dev)) { if (ifaces.hasOwnProperty(dev)) {
@ -490,7 +482,6 @@ function networkInterfaces(callback) {
if (detail.mac === mac) { if (detail.mac === mac) {
ifaceName = detail.name; ifaceName = detail.name;
dhcp = detail.dhcp; dhcp = detail.dhcp;
dnsSuffixes = detail.dnsSuffixes;
operstate = detail.operstate; operstate = detail.operstate;
speed = detail.speed; speed = detail.speed;
type = detail.type; type = detail.type;
@ -516,7 +507,6 @@ function networkInterfaces(callback) {
mtu, mtu,
speed, speed,
dhcp, dhcp,
dnsSuffixes,
carrierChanges, carrierChanges,
}); });
} }