[avahi] How to only advertise service on specific IP?
jyavenard at gmail.com
Thu Oct 10 02:25:49 PDT 2013
I have a program that advertises various services over the current LAN
The target platform is Linux, Mac OS X, BSD and Windows.
The application would typically be listening to a single IPv4 address
and optionally a single IPv6 address (as configured by the user) and a
The application would then start, start listening on the particular
IP/Port and advertise the service via Bonjour.
This is done with something like:
DNSServiceErrorType res =
DNSServiceRegister(&m_dnssref, 0, 0, (const char*)name,
NULL, 0, qport, txt_size, (void*)txt_data,
The issue is looking a Bonjour browser, is that you can see in the
service "name" being advertised, all the IP addresses set on that
machine. That includes IPv4 and IPv6 addresses.
But I only want to advertize the IP addresses I'm currently listening
on, not all of them. Otherwise, from time to time this causes problem
as the client will attempt to connect using an IP address where the
application doesn't listen on... (this happens usually with
self-assigned, deprecated IPv6 addresses)...
I've looked all over the documentation of DNSService; to no available.
Is it possible to specify which IP addresses are being advertised or not?
thanks in advance.
More information about the avahi