[avahi] [PATCH] RFC: resolve with retries

Andreas Fenkart afenkart at gmail.com
Tue Jan 27 03:58:02 PST 2015


avahi-publish -s  foobar _frop._tcp 5517
avahi-browse -r  _frop._tcp

problem:
- run the publish command on 2nd box
- check with avahi-browse that service is in avahi cache of local machine
- unplug the ethernet of the 2nd box
- wait >120s, then restart avahi-browse -> resolving will fail
- plug the cable back in, resolver will not be restarted,
  avahi-browse will not resolve the service unless restarted

Checking with wireshark, not all DNS records have the same TTL, 
The SRV entries, which is necessary for resolving, expires first
see AVAHI_DEFAULT_TTL / AVAHI_DEFAULT_TTL_HOST_NAME

Of course I'm not using avahi-browse but the avahi-client API, but the
problem remains the same. See followup patch for illustration, not meant
for inclusion.

I wonder if there is a more elegant solution for this problem
- is there a hook that I can subscribe in case a new SRV record is
  added, to restart the resolver?
- could avahi trigger AVAHI_BROWSER_REMOVE as soon as the SRV record of
  a service entry expires?

Andreas Fenkart (1):
  avahi-browse: retry resolving until success or all records expired
    from cache

 avahi-utils/avahi-browse.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

-- 
2.1.1



More information about the avahi mailing list