@@ -174,7 +174,8 @@ static void GetInterfaceAddresses(const FunctionCallbackInfo<Value>& args) {
174
174
char ip[INET6_ADDRSTRLEN];
175
175
char netmask[INET6_ADDRSTRLEN];
176
176
std::array<char , 18 > mac;
177
- Local<String> name, family;
177
+ Local<String> name;
178
+ Local<Integer> family;
178
179
179
180
int err = uv_interface_addresses (&interfaces, &count);
180
181
@@ -214,14 +215,14 @@ static void GetInterfaceAddresses(const FunctionCallbackInfo<Value>& args) {
214
215
if (interfaces[i].address .address4 .sin_family == AF_INET) {
215
216
uv_ip4_name (&interfaces[i].address .address4 , ip, sizeof (ip));
216
217
uv_ip4_name (&interfaces[i].netmask .netmask4 , netmask, sizeof (netmask));
217
- family = env->ipv4_string ( );
218
+ family = Integer::New ( env->isolate (), 4 );
218
219
} else if (interfaces[i].address .address4 .sin_family == AF_INET6) {
219
220
uv_ip6_name (&interfaces[i].address .address6 , ip, sizeof (ip));
220
221
uv_ip6_name (&interfaces[i].netmask .netmask6 , netmask, sizeof (netmask));
221
- family = env->ipv6_string ( );
222
+ family = Integer::New ( env->isolate (), 6 );
222
223
} else {
223
224
strncpy (ip, " <unknown sa family>" , INET6_ADDRSTRLEN);
224
- family = env->unknown_string ( );
225
+ family = Integer::New ( env->isolate (), 0 );
225
226
}
226
227
227
228
result.emplace_back (name);
0 commit comments