dnssd icon indicating copy to clipboard operation
dnssd copied to clipboard

fix: match DNS question with unescaped service name

Open b-kamphorst opened this issue 1 year ago • 3 comments

Closes #50

@brutella the test that I added passes for v1.2.11 and fails for v1.2.12 and v1.2.13. I identified the issue to the question/response logic as expected. Either the question should have an escaped name, or the question handler should match to the unescaped service name. I thought that it should be the latter, but please review.

Note: the test that I added is a copy of the test TestRegisterServiceWithExplicitIP with changed service name. No further thought went into that, so feel free to simplify the test.

b-kamphorst avatar Oct 08 '24 12:10 b-kamphorst

Although the test passes, the example in #50 still fails.

b-kamphorst avatar Oct 08 '24 13:10 b-kamphorst

Observation: if I first register the service with name NoSpaces and then start browsing, then in function lookupType, case req := <-ch:, for _, srv := range cache.Services(), the services have a non-empty list for srv.ifaceIPs. If the service was registered with name With Spaces instead, then the srv.ifaceIPs list is empty.

However, I'm not sure about the fix thus far (should question matching logic be altered, or rather the question itself) and I start to delve too deep for my understanding, so I'll pause here. I look forward to your thoughts!

b-kamphorst avatar Oct 08 '24 13:10 b-kamphorst

@brutella friendly asking when you expect to have time to look into this issue/PR?

b-kamphorst avatar Oct 15 '24 12:10 b-kamphorst

Sorry for the delay. Trying to look into this in the next couple of days.

brutella avatar Oct 22 '24 07:10 brutella

Fixed in v1.2.14.

brutella avatar Oct 22 '24 08:10 brutella