[avahi] IP updates in avahi-browse

Michael Krummsdorf michael.krummsdorf at ew.tq-group.com
Mon Feb 6 10:27:13 UTC 2023


Hi Esko,

thanks for the link. That explains it.
I will consider the alternatives.

Michael

-----Ursprüngliche Nachricht-----
Von: avahi [mailto:avahi-bounces at lists.freedesktop.org] Im Auftrag von Esko
Dijk
Gesendet: Sonntag, 5. Februar 2023 18:09
An: Avahi ML <avahi at lists.freedesktop.org>
Betreff: Re: [avahi] IP updates in avahi-browse

Hi Michael,

Please have a look at https://github.com/lathiat/avahi/issues/196 which
contains more details for your issue. 
So it looks like 'avahi-browse' wasn't implemented to track further IP
address changes. But a custom app implementation (or variant of
avahi-browse) can be implemented that tracks these changes.

If you think avahi-browse should support this, you could place a comment on
the above Github issue.  I'm not sure what the original intention of the -r
flag was - resolution once, or continuous ("browse") type resolution of the
IP address(es) of the service(s) found.

Best regards
Esko

-----Original Message-----
From: avahi <avahi-bounces at lists.freedesktop.org> On Behalf Of Michael
Krummsdorf
Sent: Friday, February 3, 2023 11:40
To: avahi at lists.freedesktop.org
Subject: [avahi] IP updates in avahi-browse

Hello,

I am using avahi-daemon to publish my host's IP address and a custom service
across my network.
I wish to inform any clients on the network about changes of the IP address.
On the clients I use 'avahi-browse' to detect address and services.

But avahi-browse does not report address updates after the host was assigned
a new IP.

Output before IP address change:
$ avahi-browse -r _http._tcp
+  ens37 IPv4 20230123                                      Web Site
local
=  ens37 IPv4 20230123                                      Web Site
local
   hostname = [HOST-20230123.local]
   address = [172.168.135.187]
   port = [80]
   txt = ["serial=20230123" "txtvers=1"]

** DHCP Lease ceases, host gets assigned 172.168.135.190 ** Output of
avahi-daemon:
Apr 30 18:58:44 HOST-20230123.local avahi-daemon[1888]: Withdrawing address
record for 172.168.135.187 on br0.
Apr 30 18:58:44 HOST-20230123.local avahi-daemon[1888]: Leaving mDNS
multicast group on interface br0.IPv4 with address 172.168.135.187.
Apr 30 18:58:44 HOST-20230123.local avahi-daemon[1888]: Interface br0.IPv4
no longer relevant for mDNS.
Apr 30 18:58:45 HOST-20230123.local avahi-daemon[1888]: Joining mDNS
multicast group on interface br0.IPv4 with address 172.168.135.190.
Apr 30 18:58:45 HOST-20230123.local avahi-daemon[1888]: New relevant
interface br0.IPv4 for mDNS.
Apr 30 18:58:45 HOST-20230123.local avahi-daemon[1888]: Registering new
address record for 172.168.135.190 on br0.IPv4.


There is no update on the IP address in the still-running avahi-browse
process at the client.

If I restart avahi-browse now, the output contains the new IP.
When I call 'ping HOST-20230123.local' it does resolve the old and new IP
correctly for the ping.

I also see that RFC6762
(https://datatracker.ietf.org/doc/html/rfc6762#section-8.4) covers IP
address changes in Section 8.4. "Updating" so I expected avahi to publish
address changes automatically.

Is my expectation wrong? Should I be able to see IP updates in avahi-browse
at all?
If not, how can the client get informed about IP updates?

Thanks,
Michael






More information about the avahi mailing list