-
Notifications
You must be signed in to change notification settings - Fork 219
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] fix bug that avahi may publish redundant meshcop services #1104
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1104 +/- ##
=======================================
Coverage 56.76% 56.77%
=======================================
Files 85 85
Lines 6352 6358 +6
=======================================
+ Hits 3606 3610 +4
- Misses 2746 2748 +2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
c1b8a33
to
bcfd52c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 👍🏼
…nthread#1104) Avahi may rename the meshcop service and publish it when there's a name conflict. However, our current logic has a bug that it may publish redundant meshcop services after some renaming. For example there are two BRs on the infra link: - BR1 starts. It publishes instance._meshcop._udp. - BR2 starts. It publishes instance openthread#1._meshcop._udp. - BR1 stops. It unpublishes instance._meshcop._udp. - BR2 wants to update the existing meshcop service. However, it actually publishes a new service instance._meshcop._udp. There are two meshcop services existing at the same time both published by BR2. To fix this bug, we will keep track of the original name in the avahi publisher. When we call PublishService, we should always pass in the original name and let the publisher handle the renaming. In this way we will be able to find the wanted service when updating it or unpublishing it. GitOrigin-RevId: d14c225 (cherry picked from commit 33eb9b87edade197db47f857836ef1642d74ee33)
Avahi may rename the meshcop service and publish it when there's a name conflict. However, our current logic has a bug that it may publish redundant meshcop services after some renaming.
For example there are two BRs on the infra link:
instance._meshcop._udp
.instance #1._meshcop._udp
.instance._meshcop._udp
.instance._meshcop._udp
. There are two meshcop services existing at the same time both published by BR2.To fix this bug, we will keep track of the original name in the avahi publisher. When we call
PublishService
, we should always pass in the original name and let the publisher handle the renaming. In this way we will be able to find the wanted service when updating it or unpublishing it.The test case is covered in openthread/openthread#7192.