avahi
avahi copied to clipboard
Don't conflict with self
If during registration of our own records there is an address change or address removed and re-added then avahi-daemon
interprets its own probe as conflicting (due to presence of different or temporary non-existing address in the probe). And then it changes its name to hostname-2
and retries.
Change of hostname without good reason could be unexpected and annoying.
To resolve this we ignore presence of non-matching records if they were sent by us.
This change resolves https://github.com/lathiat/avahi/issues/117 for me.
I can confirm the patch in this PR fixes the problem for me on an embedded platform that operates avahi on a network bridge device. Thanks a lot for sharing!
Thank you for the feedback!
What's the ETA on this? I will try this patch to see if this fixes my observed issues.
Can you provide instructions on how to test this locally in a debian installation (installed throug apt-get)?
@ffleandro, you could try to ask project author about the ETA in the original bug: https://github.com/lathiat/avahi/issues/117. Last reply from lathiat there is dated Dec 7, 2020. And sorry I can't provide you with instructions. If you don't know how to apply patch and how to build avahi from sources I don't think you should even try. As you can put your system to a broken state from which you don't know how to rollback by yourself.
Hi! I'm running this patch for about two weeks now and never encountered #117 again. But I found a regression, MYHOSTNAME.local is now only reachable from the other machines in the network. Is this intended behavior?
Thank you for the feedback. The regression which you described is not intended. I follow up if I see how to address it.
I think this is important fix. I have seen myself changed name of my laptop. I am pretty sure there were not another device with the same name, but my laptop were connected to two interfaces simultaneously.
Code change seems reasonable. But I haven't tested myself whether it helps indeed.
This comment mentions a regression which is apparently acknowledged by the original author of the patch (next comment). Are you sure this change is safe?
No, I am not sure. I looks well in general. Thanks for pointing to a regression. Do I understand it correctly that this change should make not working this command: avahi-resolve -n $HOSTNAME.local
?
But yes, it changes the behaviour of local resolving of hostname and its reverse IPv4 address.
Hi, I may have found another regression. Mounting Samba shares using the .local
hostname is significantly slower than without the patch. But maybe this is actually a Samba issue.