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

Already on GitHub? Sign in to your account

src: include scopeid for IPv6 addresses #4880

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
4 participants

upsuper commented Mar 1, 2013

Include scopeid for IPv6 addresses in the output of os.networkInterfaces.

@upsuper upsuper src: include scopeid for IPv6 addresses
Include scopeid for IPv6 addresses in the output of `os.networkInterfaces`.
a85117b

@bnoordhuis bnoordhuis and 1 other commented on an outdated diff Mar 1, 2013

src/node_os.cc
@@ -235,6 +235,10 @@
o = Object::New();
o->Set(String::New("address"), String::New(ip));
o->Set(String::New("family"), family);
+ if (interfaces[i].address.address4.sin_family == AF_INET6) {
+ o->Set(String::New("scopeid"),
+ Number::New(interfaces[i].address.address6.sin6_scope_id));
@bnoordhuis

bnoordhuis Mar 1, 2013

Owner

Style: arguments should line up.

I guess it could be a call to Integer::NewFromUnsigned() because sin6_scope_id is a uint32_t.

@upsuper

upsuper Mar 1, 2013

@bnoordhuis OK, I'll fix those problems. Do you have any suggestion for that the second line is still too long?

@bnoordhuis

bnoordhuis Mar 1, 2013

Owner
uint32_t scope_id = interfaces[i].address.address6.sin6_scope_id;
o->Set(String::New("scopeid"), Integer::NewFromUnsigned(scope_id));

?

Can one of the admins verify this patch?

Rebased and squashed, thanks! Landed in ae02992

@tjfontaine tjfontaine closed this Feb 18, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment