Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/node_os.cc')
-rw-r--r--src/node_os.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/node_os.cc b/src/node_os.cc
index 6e62af00f5f..046a6106ccd 100644
--- a/src/node_os.cc
+++ b/src/node_os.cc
@@ -174,8 +174,7 @@ static void GetInterfaceAddresses(const FunctionCallbackInfo<Value>& args) {
char ip[INET6_ADDRSTRLEN];
char netmask[INET6_ADDRSTRLEN];
std::array<char, 18> mac;
- Local<String> name;
- Local<Integer> family;
+ Local<String> name, family;
int err = uv_interface_addresses(&interfaces, &count);
@@ -215,14 +214,14 @@ static void GetInterfaceAddresses(const FunctionCallbackInfo<Value>& args) {
if (interfaces[i].address.address4.sin_family == AF_INET) {
uv_ip4_name(&interfaces[i].address.address4, ip, sizeof(ip));
uv_ip4_name(&interfaces[i].netmask.netmask4, netmask, sizeof(netmask));
- family = Integer::New(env->isolate(), 4);
+ family = env->ipv4_string();
} else if (interfaces[i].address.address4.sin_family == AF_INET6) {
uv_ip6_name(&interfaces[i].address.address6, ip, sizeof(ip));
uv_ip6_name(&interfaces[i].netmask.netmask6, netmask, sizeof(netmask));
- family = Integer::New(env->isolate(), 6);
+ family = env->ipv6_string();
} else {
strncpy(ip, "<unknown sa family>", INET6_ADDRSTRLEN);
- family = Integer::New(env->isolate(), 0);
+ family = env->unknown_string();
}
result.emplace_back(name);