From cd63a41c880d36623b7370a449d2bd18144d46ce Mon Sep 17 00:00:00 2001 From: Amy Yan Date: Mon, 16 Oct 2023 18:14:29 +1100 Subject: [PATCH] fix: response records with link-local addresses from non link-local network interfaces are ignored --- src/MDNS.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/MDNS.ts b/src/MDNS.ts index 7ded359..4354c18 100644 --- a/src/MDNS.ts +++ b/src/MDNS.ts @@ -939,8 +939,13 @@ class MDNS { partialService.hosts = []; } let host = responseRecord.data; - if (host.startsWith('fe80:') && remoteNetworkInterfaceIndex != null) { - host = `${host}%${remoteNetworkInterfaceIndex}` as Host; + if (host.startsWith('fe80')) { + if (remoteNetworkInterfaceIndex != null) { + host = `${host}%${remoteNetworkInterfaceIndex}` as Host; + } + else { + continue; + } } partialService.hosts.push(host); }