Public bug reported:

Trying to use avahi-autoipd on a USB network interface, which gets
created when I connect a USB gadget (g_ether) device (my raspberry pi
zero). Avahi-autoipd fails to assign an IPv4LL address, and instead
reports:

# avahi-autoipd enp0s29u1u2
Found user 'avahi-autoipd' (UID 110) and group 'avahi-autoipd' (GID 120).
Successfully called chroot().
Successfully dropped root privileges.
Starting with address 169.254.7.125
Callout BIND, address 169.254.7.125 on interface enp0s29u1u2
client: RTNETLINK answers: Numerical result out of range
Script execution failed with return value 2
Successfully claimed IP address 169.254.7.125

Although avahi-autoipd claims that the IP address gets configured,
ifconfig shows that it didn't succeed.

The root cause is that the label for the interface exceeds the maximum
length of 15 characters. This happens in line 44 of /etc/avahi/avahi-
autoipd.action:

ip addr add "$3"/16 brd 169.254.255.255 label "$2:avahi" scope link dev
"$2"

With $2 the interface name, and $3 the IPv4LL address that it wants to
claim.

Interface names and label names can only be 15 characters in length,
this is a kernel limitation. IF_NAMESIZE = 16, leaving 15 chars for the
name, see /usr/include/net/if.h and IFNAMSIZ in the kernel includes.

The rather long interface name, appended with ":avahi", exceeds this
length. This results in the 'Numerical result out of range' error
message.

Workaround: I've edited the /etc/avahi/avahi-autopid.action script to
only append ":a" for the label (lines 44 and 50) ,and in this case it
works as designed.

avahi-autoipd should perhaps check that the label does not exceed this
limit of 15 characters.

Note that the label must start with the full interface name, see ip-
address(8).

A more compact interface name would be helpful, as these long interface names 
tend to break
other things as well. The kernel assigns 'usb0', but this gets changed right 
away.

This occurs on both 16.04 and 16.10, haven't tried any other versions
yet.

** Affects: avahi (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1666900

Title:
  avahi-autoipd fails because network interface name is too long

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/avahi/+bug/1666900/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to