dhcpcd-discuss

Re: ipv6_newaddr: Invalid argument

Roy Marples

Tue Jun 18 08:06:43 2019

Hi Breno

On 17/06/2019 17:15, Breno Leitao wrote:
I have a Linux system where dhcpcd is responsible for all the IPv6 network config, and Linux has autoconf disabled (/proc/sys/net/ipv6/conf/all/autoconf = 0).

Everything works pretty well, but I am getting the following error from time to time, which is annoying:

     ipv6_newaddr: Invalid argument

The problem seems to be related to ipv6_newaddr() being called with a package with IPV6_AF_AUTOCONF set, and prefix = 128.

Since the package is IPV6_AF_AUTOCONF, then ipv6_makeaddr() is called, and it returns EINVAL as saw above:

     if (prefix_len < 0 || prefix_len > 120) {
         errno = EINVAL;
          return -1;
      }

Are you sure?
It's very unlikely SLAAC would emit a /128 prefix - it would service literally no purpose. A /128 prefix is used for DHCPv6 addresses for use on a lower matching prefix handed out by RA.

Could you add this to /etc/dhcpcd.conf and then restart it and email me the log please?
debug
logfile /var/log/dhcpcd.log

Since I am new to the IPv6 world, I was wondering if I should enable dhcpcd to handle temporary address (IPV6_MANAGETEMPADDR), but, looking further, it seems this option is disabled on Linux:

     #if defined(IN6_IFF_TEMPORARY) && !defined(__linux__)
     #define IPV6_MANAGETEMPADDR
     #endif

Linux does not allow userland to set temporary addresses.
However, it does allow userland to mark addresses as the basis for managing temporary addresses from, which is almost as good.

That said, I am wondering if I am reading the problem properly, and if my debug makes any sense.

Generally when Linux users report the error you are seeing, it's because the kernel headers are mismatched from the actual kernel you are running.
Let us look at the dhcpcd debug log first and try and work more out.

Roy

Follow-Ups:
Re: ipv6_newaddr: Invalid argumentBreno Leitao
References:
ipv6_newaddr: Invalid argumentBreno Leitao
Archive administrator: postmaster@marples.name