Mazze
Mazze

Reputation: 1404

Avahi DNS-SD on multiple IP addresses

Background:

I'm trying to communicate with an IP camera without the need of a DHCP server. This is how the camera acquires an IP address:

  1. Basic DHCP procedure (discover etc.)
  2. If above should fail the camera has a fallback address of 192.168.0.90
  3. The camera then starts the avahi-daemon and successfully gets a link-local address too for robustness
  4. The IP aliasing is now done and the interface has two IPs.

Problem:

Now the problem is that when I avahi-browse to browse the services on the network, the camera replies with both IP addresses (checked with Wireshark).

Only one is shown by avahi and it could be the zeroconf:ed address or the fallback address.

I want the link local address only, not the fallback. Any reliable way to get it?

Upvotes: 4

Views: 3778

Answers (1)

Grodriguez
Grodriguez

Reputation: 21995

Old question but just in case someone else has the same problem:

  • Avahi will only return one of the IP addresses reported by the device. This seems to be a (debatable) design decision and is explained in this post of the avahi mailing list. So I'm afraid there's no reliable way to get only the link-local address, if you are using avahi-browse.
  • On a side note, RFC3927 section 1.9 specifically recommends NOT to configure both a routable address and a link-local address simultaneously for the same interface. But I do understand this is the camera's behaviour and probably outside your control.

Upvotes: 2

Related Questions