fix(net): skip empty mac address for getNetworkAddress() (#5941)

fix(net) skip empty mac address
This commit is contained in:
David 2024-09-12 01:11:25 +02:00 committed by GitHub
parent 8d7e184943
commit 6ba3810544
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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")