From 6ba3810544dcafddc05a559bd9d04d36e8adeb07 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 12 Sep 2024 01:11:25 +0200 Subject: [PATCH] fix(net): skip empty mac address for `getNetworkAddress()` (#5941) fix(net) skip empty mac address --- net/get_network_address.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/net/get_network_address.ts b/net/get_network_address.ts index 8c75f074b..bbad85469 100644 --- a/net/get_network_address.ts +++ b/net/get_network_address.ts @@ -39,6 +39,7 @@ export function getNetworkAddress( return Deno.networkInterfaces() .find((i) => i.family === family && + i.mac !== "00:00:00:00:00:00" && (family === "IPv4" // Cannot lie within 127.0.0.0/8 ? !i.address.startsWith("127")