Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deviceList() return nothing #6

Closed
Befzz opened this issue Nov 29, 2013 · 5 comments
Closed

deviceList() return nothing #6

Befzz opened this issue Nov 29, 2013 · 5 comments

Comments

@Befzz
Copy link

Befzz commented Nov 29, 2013

if i comment this line:
Address->Set(String::New(key), String::New(address));
then (after rebuilding) deviceList() retun something

problem here:

Address->Set(String::New(key), String::New(address));

right here:

String::New(address)

it fails when 'address' equal NULL

so, this code works fine:

if( address == NULL ) {
    Address->Set(String::New(key), String::New("null"));
} else {
    Address->Set(String::New(key), String::New(address));
}
@mscdex
Copy link
Owner

mscdex commented Nov 29, 2013

Well, if null is being returned, that means there's an error. What is errno set to after null is returned for that particular address? What platform are you on?

@Befzz
Copy link
Author

Befzz commented Nov 30, 2013

Windows 64bit, latest nodejs, VC2012 Express

WSAAddressToString fails with errors 10014 and 10022 (explained here http://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx)

UPD 1;
inet_ntop called for INET6 fails,
but for INET4 works well
UPD 2:
for INET6 address(like a "fe80::cda4:f344:6b4d:2f55"(i see it in windows)) WSAAddressToString returning error code 10014
for INET6 mask/broadaddr (they are empty) WSAAddressToString returning err code 10022

@mscdex
Copy link
Owner

mscdex commented Nov 30, 2013

Ok, can you try the master branch? 6656511 should fix this.

@Befzz
Copy link
Author

Befzz commented Nov 30, 2013

  • works!
console.log(require('util').inspect(Cap.deviceList(),{depth:5}));

result:

[ { name: '\\Device\\NPF_{5B026FDA-8B7B-48B9-A4A2-2A8E27081FF0}',
    description: 'Realtek PCIe GBE Family Controller',
    addresses:
     [ { addr: 'fe80::7103:3f61:9bb:7302',
         netmask: undefined,
         broadaddr: undefined },
       { addr: '0.0.0.0',
         netmask: '255.0.0.0',
         broadaddr: '255.255.255.255' } ] },
  { name: '\\Device\\NPF_{A43B19E0-E880-4DED-BCCD-D82EE339EB48}',
    description: 'Microsoft',
    addresses:
     [ { addr: 'fe80::5c31:b286:9dc1:bebe',
         netmask: undefined,
         broadaddr: undefined },
       { addr: '192.168.0.100',
         netmask: '255.255.255.0',
         broadaddr: '255.255.255.255' } ] },
  { name: '\\Device\\NPF_{1106D8D7-5ECA-4C7C-86DB-00C34340A4FD}',
    description: 'Microsoft',
    addresses:
     [ { addr: 'fe80::cda4:f39b:6b1d:2f55',
         netmask: undefined,
         broadaddr: undefined },
       { addr: '0.0.0.0',
         netmask: '255.0.0.0',
         broadaddr: '255.255.255.255' } ] } ]

@mscdex
Copy link
Owner

mscdex commented Dec 1, 2013

Thanks for the confirmation. Published fix in v0.0.7 now on npm.

@mscdex mscdex closed this as completed Dec 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants