avahi icon indicating copy to clipboard operation
avahi copied to clipboard

Don't conflict with self

Open vladmovchan opened this issue 4 years ago • 11 comments

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.

vladmovchan avatar Oct 02 '20 13:10 vladmovchan

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!

zonque avatar Feb 26 '21 15:02 zonque

Thank you for the feedback!

vladmovchan avatar Feb 26 '21 16:02 vladmovchan

What's the ETA on this? I will try this patch to see if this fixes my observed issues.

ffleandro avatar Mar 24 '21 15:03 ffleandro

Can you provide instructions on how to test this locally in a debian installation (installed throug apt-get)?

ffleandro avatar Mar 24 '21 17:03 ffleandro

@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.

vladmovchan avatar Mar 24 '21 18:03 vladmovchan

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?

SoongNoonien avatar Sep 10 '22 09:09 SoongNoonien

Thank you for the feedback. The regression which you described is not intended. I follow up if I see how to address it.

vladmovchan avatar Sep 10 '22 09:09 vladmovchan

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.

pemensik avatar Oct 11 '22 19:10 pemensik

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?

guillerodriguez avatar Nov 27 '22 01:11 guillerodriguez

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.

pemensik avatar Nov 27 '22 14:11 pemensik

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.

SoongNoonien avatar Nov 04 '23 13:11 SoongNoonien