Sometimes it happens Avahi can register local service under a hostname of different machine, if the local daemon enforces the hostname as parameter, but the hostname is already taken by different machine.
If NULL is passed as hostname into Avahi API for adding services, Avahi figures out hostname and IP address to use based on interface index passed into the function, and handles hostname changes as well.
This way enables adding services to localhost only, because Avahi takes localhost as an invalid FQDN (unless the machine hostname is localhost). The current way of how to share the service on localhost only in Avahi is to use interface index for loopback and pass NULL as hostname.
Sometimes it happens Avahi can register local service under a hostname of different machine, if the local daemon enforces the hostname as parameter, but the hostname is already taken by different machine.
If NULL is passed as hostname into Avahi API for adding services, Avahi figures out hostname and IP address to use based on interface index passed into the function, and handles hostname changes as well.
This way enables adding services to localhost only, because Avahi takes localhost as an invalid FQDN (unless the machine hostname is localhost). The current way of how to share the service on localhost only in Avahi is to use interface index for loopback and pass NULL as hostname.