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

[mdns] let avahi use RecordBrowser to resolve addresses of a service #1875

Merged
merged 1 commit into from
May 24, 2023

Conversation

superwhd
Copy link
Contributor

@superwhd superwhd commented May 22, 2023

Avahi only returns one of the host's addresses in the service resolution callback. However, the address may be link-local so it may not be preferred from Thread's perspective. We want to go through the complete list of addresses associated with the host and choose a routable address. Therefore we use RecordBrowser which can do this job.

@superwhd superwhd force-pushed the avahi-resolve-all-addresses branch from 174fbe7 to 967a1f6 Compare May 22, 2023 04:21
src/mdns/mdns_avahi.cpp Outdated Show resolved Hide resolved
src/mdns/mdns_avahi.cpp Outdated Show resolved Hide resolved
src/mdns/mdns_avahi.cpp Outdated Show resolved Hide resolved
@superwhd superwhd force-pushed the avahi-resolve-all-addresses branch from 967a1f6 to 7519c76 Compare May 22, 2023 08:45
@superwhd superwhd marked this pull request as ready for review May 22, 2023 08:50
@superwhd superwhd changed the title [WIP] let avahi use RecordBrowser to resolve addresses of a service [mdns] let avahi use RecordBrowser to resolve addresses of a service May 22, 2023
Copy link
Contributor

@sunytt sunytt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@superwhd
Copy link
Contributor Author

openthread/openthread#9075 covers the test case.

https://github.com/openthread/openthread/actions/runs/5043589092 Shows an example that the previous implementation cannot handle this.

src/mdns/mdns_avahi.cpp Outdated Show resolved Hide resolved
src/mdns/mdns_avahi.cpp Outdated Show resolved Hide resolved
@superwhd superwhd force-pushed the avahi-resolve-all-addresses branch from df9fa36 to fcc8a0a Compare May 23, 2023 09:21
@superwhd superwhd force-pushed the avahi-resolve-all-addresses branch from fcc8a0a to 0a3fd93 Compare May 23, 2023 09:29
@superwhd superwhd requested a review from bukepo May 23, 2023 09:30
@librasungirl librasungirl requested a review from wgtdkp May 23, 2023 11:22
Copy link
Contributor

@librasungirl librasungirl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@librasungirl librasungirl requested review from jwhui and removed request for wgtdkp May 24, 2023 05:36
@jwhui jwhui merged commit 1740a69 into openthread:main May 24, 2023
31 checks passed
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.

None yet

5 participants