[avahi] Resolve multiple IP4 Addresses
daniel.wynne at mobotix.com
Thu May 7 00:06:23 PDT 2009
On Wed, 06.05.09 10:02, Daniel Wynne (daniel.wynne at mobotix.com) wrote:
> Dear Mr. Poettering,
> I was just playing around a little bit trying to implement a
> Bonjour-like service on Linux using the Avahi Client API.
> The devices I tried to contact answer with several IP4 addresses.
> Unfortunately the Avahi client delivered always just one address.
> Is this an implementation issue, or am I doing something wrong?
> If it is an implementation issue, is there an easy way to bring Avahi
> deliver all IP addresses?
This behaviour is by design. Due to the way mDNS works we can never
reliably know if we received the full response, i.e. the full list of
A RRs for a specific hostname. There is no signal that could tell us
"Hey, you've now received *all* possible replies" which we could then
use to trigger forwarding of the responses to the clients.
On Bonjour they fake this behaviour by passing all A RRs from the
first response message to the user. i.e. they actually do not give you
the full list of addresses, but only the list of all addresses from
the first reply (which very often turns out to be the same though).
I decided not to copy this behaviour in Avahi because it this makes a
promise we cannot always keep. In addition it is simpler to hand only
one address back. On the local network it shouldn't matter which
address is returned as long as it is a valid one. Avahi also goes in
great length to publish only a single address itself on each interface,
the one that is most likely the most useful. There is no point in
publishing more than one and also no need to resolve more than one.
Usually, applications which rely on the resolving of more than one
adress are misuing mDNS. Why do you need it in your applicaiton?
(Nonetheless there is a work around for this issue: If you use a
lower-leve record browser object you can actually browse for all A RRs
if you wish to.)
On Wed, 2009-05-06 at 14:58 +0200, Daniel Wynne wrote:
> Hi All!
> I was playing around a little bit using the client API and wondered if
> it is possible to resolve all IP4 addresses delivered to the client, not
> just one.
> Is there any way to achieve that? As an orientation I used the
> CLient-Browse example shipped with the Avahi package.
> Thanx for your time
> avahi mailing list
> avahi at lists.freedesktop.org
More information about the avahi