[avahi] AVAHI behaving differently with Mac clients?

Tim tghewett2 at onetel.com
Fri Feb 21 14:58:04 PST 2014

I have a service which registers with AVAHI on Linux and DNS-SD when running on
Macs. When browsing for the service on a Mac I find that the service registered
with AVAHI behaves differently to the same service registered with DNS-SD on

This can lead to the AVAHI entry becoming unlisted while the Mac entries
remain listed fine.

The context is this:

On Macs it is possible to give all the computer's network interfaces the same IP
address. This does not result in a conflict because it is possible to give the
interfaces a hierarchical priority, e.g. to give the 1000baseT i/f top priority
but if it is not connected and running to then fall back to Wifi.

In that priority scenario, if the 1000baseT i/f is connected (with the Wifi i/f
also running but not being used due to its lower priority), the service listing 
or the other Macs is added for the Ethernet and listed as
being available on both interfaces. If the 1000baseT cable is removed, the
service is removed from that i/f but not the Wifi as it is still running (and
the Wifi i/f then becomes the prime interface again).

However the AVAHI-registered service does not get added at the point that the
Ethernet is connected, it remains listed for the Wifi i/f only. Disabling Wifi
causes its listing for that i/f to be removed, meaning that
host's service no longer has any listing at all. Sometimes disabling Wifi
provokes the AVAHI-registered service to be added for the Ethernet, sometimes
it remains with no listing at all as is shown in the capture
below. The services were registered with "avahi-publish -s raspi _test._tcp
1234" and "dns-sd -R mini _test._tcp . 1234".

Here the Ethernet has i/f index 4 and Wifi i/f index 5. Both mini and raspi are
on the same LAN as are the client computer's Wifi and Ethernet interfaces.

[macbook:~] me% dns-sd -B _test._tcp
Browsing for _test._tcp
DATE: ---Fri 21 Feb 2014---
22:15:40.473  ...STARTING...
Timestamp     A/R    Flags  if Domain               Service Type       Instance
22:15:40.473  Add        3   5 local.               _test._tcp.          mini
22:15:40.473  Add        3   5 local.               _test._tcp.          raspi
22:15:40.473  Add        3   4 local.               _test._tcp.          raspi
22:15:40.473  Add        2   4 local.               _test._tcp.          mini
^^^^ start: Wifi on, Ethernet on, services shown for Mac Mini and Raspberry Pi
for both interfaces
22:16:01.564  Rmv        1   4 local.               _test._tcp.          raspi
22:16:01.564  Rmv        0   4 local.               _test._tcp.          mini
^^^^ disconnect Ethernet, service removed for mini and raspi
22:16:22.889  Add        2   4 local.               _test._tcp.          mini
^^^^ connect Ethernet, service added for mini but NOT raspi
22:16:52.132  Rmv        1   5 local.               _test._tcp.          mini
22:16:52.132  Rmv        0   5 local.               _test._tcp.          raspi
^^^^ disable Wifi, service removed for mini and raspi, now no service listed at
all for raspi
22:17:44.173  Rmv        0   4 local.               _test._tcp.          mini
^^^^ disconnect Ethernet, mini removed but no raspi entry to remove
22:17:53.001  Add        2   4 local.               _test._tcp.          mini
^^^^ connect Ethernet, back come both hosts
22:17:53.025  Add        2   4 local.               _test._tcp.          raspi
22:18:10.989  Add        2   5 local.               _test._tcp.          raspi
^^^^ enable Wifi, back come both hosts
22:18:11.052  Add        2   5 local.               _test._tcp.          mini

Is this a configuration issue, a bug, or just different behaviour within the
spec? Is there a way to get the AVAHI service to behave the same way as the
DNS-SD one?

More information about the avahi mailing list