[avahi] Link local IPV6 addresses

Lennart Poettering lennart at poettering.net
Fri Feb 2 08:41:19 PST 2007


On Mon, 08.01.07 09:32, Alexander Larsson (alexl at redhat.com) wrote:

Hi!

Sorry for the late response, I've been attending linux.conf.au and
travelling through .au and didn't read much emails during that time.

> I recently ran into an issue with link local ipv6 addresses and avahi.
> The machine i ran on was ipv6-enabled, but on a non-ipv6 network. This
> meant that the ipv6 address used on the eth0 iface was a randomly picked
> "link-local" address. Avahi would then announce both an ipv4 and an ipv6
> service, and if you query for both it would return the ipv6 one by
> default.
> 
> However, the link local ipv6 address is quite a pain in the ass to use.
> For instance, any use of it with the socket api requires you to also
> specify the iface to use, meaning you have to special case things, and
> you can't store the address in an ip address only field.
> 
> It would be nice if Avahi could default to return the ipv4 address if
> there is both an ipv6/ipv4 versions and the ipv6 address is link-local.

This wouldn't work. Unfortunately most applications first query for
IPv6 hostnames and then for IPv4 hostnames. i.e. the order which
address we return first is not specified by us, but depends on the
application.

I am not quite sure what to do about this. 

Isn't it possible to set a proper IPv6 route for the link-local block and
thus allowing usage of those addresses even without specifying the
interface on connect()? That way IPv6 link-local addresses would
behave much the same way as IPv4 link-local addresses. -- if this is
is not possible with current Linux kernels, then maybe it's time to fix
the kernel. Otherwise people will never start to use IPv6 link-local
addresses for anything useful.

In short: I believe the proper place to fix this is the Linux kernel,
not Avahi. However, I am open for suggestions for a clean workaround
in Avahi (unfortunately I don't see any that would work right now).

BTW: This issue is one of the reasons why IPv6 is disabled by default
in upstream Avahi.

Lennart

-- 
Lennart Poettering; lennart [at] poettering [dot] net
ICQ# 11060553; GPG 0x1A015CC4; http://0pointer.net/lennart/


More information about the avahi mailing list