Skip to content

Commit ac1764d

Browse files
author
Oren Novotny
committed
Don't filter source so echo's across vlan's work.
Fixes #145
1 parent 60e682c commit ac1764d

File tree

1 file changed

+4
-22
lines changed

1 file changed

+4
-22
lines changed

Zeroconf/ZeroconfResolver.cs

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -46,31 +46,13 @@ void Converter(IPAddress address, byte[] buffer)
4646
Debug.WriteLine($"IP: {addrString}, {(string.IsNullOrEmpty(name) ? string.Empty : $"Name: {name}, ")}Bytes: {buffer.Length}, IsResponse: {resp.header.QR}");
4747

4848
if (resp.header.QR)
49-
{
50-
// see if the IP is the same as the A to filter out dups that might echo from other interfaces
51-
52-
53-
var aRec = resp.RecordsA.FirstOrDefault();
54-
var additionalARec = resp.Additionals.FirstOrDefault(arr => arr.Type == Type.A)?.RECORD as RecordA;
55-
56-
// if we have an aRec or additionalARec, check those
57-
bool? matches = null;
58-
if (aRec != null || additionalARec != null)
49+
{ var key = $"{addrString}{(string.IsNullOrEmpty(name) ? "" : $": {name}")}";
50+
lock (dict)
5951
{
60-
matches = string.Equals(aRec?.Address, addrString, StringComparison.OrdinalIgnoreCase) ||
61-
string.Equals(additionalARec?.Address, addrString, StringComparison.OrdinalIgnoreCase);
52+
dict[key] = resp;
6253
}
63-
64-
if (matches ?? true)
65-
{
66-
var key = $"{addrString}{(string.IsNullOrEmpty(name) ? "" : $": {name}")}";
67-
lock (dict)
68-
{
69-
dict[key] = resp;
70-
}
7154

72-
callback?.Invoke(key, resp);
73-
}
55+
callback?.Invoke(key, resp);
7456
}
7557
}
7658

0 commit comments

Comments
 (0)