Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Change .local domain heuristic #84

Merged
merged 2 commits into from
Dec 8, 2022

Conversation

pemensik
Copy link
Member

@pemensik pemensik commented Dec 6, 2022

Previous way skipped all multicast queries when unicast DNS contains local. SOA record. Change that behaviour and always request multicast name. But if local SOA is present, then make missing multicast optional and continue to DNS plugin. That would make names ending with .local to take longer resolve on unicast DNS, but should still deliver the answer.

Attempts to improve issue #75.

Previous way skipped all multicast queries when unicast DNS contains
local. SOA record. Change that behaviour and always request multicast
name. But if local SOA is present, then make missing multicast optional
and continue to DNS plugin. That would make names ending with .local to
take longer resolve on unicast DNS, but should still deliver the answer.
@agoode
Copy link
Collaborator

agoode commented Dec 6, 2022

Thanks for this PR! It looks pretty good!

Are there any tests you can add to https://github.com/lathiat/nss-mdns/blob/master/tests/check_util.c ?

@pemensik
Copy link
Member Author

pemensik commented Dec 7, 2022

Oh, this is related to old chromium bug http://crbug.com/626377 and PR #1 in this very repository.

@pemensik
Copy link
Member Author

pemensik commented Dec 7, 2022

This PR is related to issues #75 and #79. It is just the first of multiple planned steps, to ensure something.local can be resolved also over (unicast) DNS in case the .local domain exists in the local server.

Possible resolution might be also to disable browsing on per-network setting in avahi-daemon, as requested in issue avahi/avahi#386. Because the original implementation efectively disables all mdns addresses resolution, at least via nss plugin. If we could reuse already existing connection.mdns property of connection in Network Manager, we would have a better workaround.

@pemensik
Copy link
Member Author

pemensik commented Dec 7, 2022

Are there any tests you can add to https://github.com/lathiat/nss-mdns/blob/master/tests/check_util.c ?

I have not found straight forward way to test different results of local_soa() function in unit test. Unit test would have to provide some mock function to provide answers independent on the actual network, where is the test running. Of course it is doable, I think we can make function pointer as one of parameters.

Use new enum to specify forced present or missing .local SOA record. Use
from production code auto value, but use forced values from unit test.
Add few different results to unit test.
@agoode agoode merged commit 6ff4745 into avahi:master Dec 8, 2022
@zdohnal
Copy link

zdohnal commented Jan 10, 2023

@agoode it would be great if the PR was backported into Fedora or a new release was made - it helps with automatic driverless device installation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants