Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: if_addrflags6: Can't assign requested address



On 2018/08/18 2:45, Roy Marples wrote:
> On 17/08/2018 10:08, Roy Marples wrote:
>> On 17/08/2018 09:04, Masanobu SAITOH wrote:
>>>> wm2: carrier lost
>>>> wm2: executing `/libexec/dhcpcd-run-hooks' NOCARRIER
>>>> wm2: deleting address fe80::1392:4012:56d8:a7a2
>>>> wm2: if_addrflags6: Can't assign requested address
>>>> wm2: if_addrflags6: Can't assign requested address
>>>> wm2: if_addrflags6: Can't assign requested address
>>>> wm2: if_addrflags6: Can't assign requested address
>>>> wm2: carrier acquired
>>>> wm2: executing `/libexec/dhcpcd-run-hooks' CARRIER
>>
>> This helps.
>> I never saw this because on NetBSD-8, we have addrflags available in ifa_msghdr when sent over route(4). This does not exist on NetBSD-7 so we need to make an ioctl per address to work out the flags. Sadly, this is racy and this is what happens:
>>
>> Something adds an address.
>> Kernel annnounces new address to route(4).
>> Something deletes this address.
>> Kernel announces the address deleted to route(4).
>>
>> dhcpcd reads the address added message from route(4) *after* the address has been deleted from the kernel. Because dhcpcd needs the address flags at this point, an ioctl is made to the deleted address and boom, error.
>>
>> Luckily dhcpcd handles it correctly and it's just noise.
>> Please test the attached patch to silence it.
>> If you can verify it works, let me know and I'll push a new version out.
> 
> Since then I've discovered two more critical issues with dhcpcd-7 on NetBSD-7.
> 1) Broken IP_PKTINFO implementation
> 2) Invalid RTA_BRD in RTM_NEWADDR messages for new addresses
> Both of these have already been fixed in -8 and -current and neither looks suitable for a pullup and dhcpcd needs a workaround for both anyway.
> 
> A better patch attached and I'll hopefully get this pushed out over the weekend.
> 
> Roy

This patch worked. if_addrflags6's error messages disappeared.

Before this patch,

> Aug 18 01:00:58 amd64-n7 dhcpcd[250]: wm1: dhcp_sendudp: Invalid argument
> Aug 18 01:30:59 amd64-n7 dhcpcd[250]: wm1: dhcp_sendudp: Invalid argument
> Aug 18 02:01:01 amd64-n7 dhcpcd[250]: wm1: dhcp_sendudp: Invalid argument
> Aug 18 02:31:03 amd64-n7 dhcpcd[250]: wm1: dhcp_sendudp: Invalid argument
> Aug 18 03:01:04 amd64-n7 dhcpcd[250]: wm1: dhcp_sendudp: Invalid argument
> Aug 18 03:31:05 amd64-n7 dhcpcd[250]: wm1: dhcp_sendudp: Invalid argument
> Aug 18 04:01:06 amd64-n7 dhcpcd[250]: wm1: dhcp_sendudp: Invalid argument
> Aug 18 04:31:08 amd64-n7 dhcpcd[250]: wm1: dhcp_sendudp: Invalid argument
> Aug 18 05:01:09 amd64-n7 dhcpcd[250]: wm1: dhcp_sendudp: Invalid argument
> Aug 18 05:31:11 amd64-n7 dhcpcd[250]: wm1: dhcp_sendudp: Invalid argument
> Aug 18 06:01:11 amd64-n7 dhcpcd[250]: wm1: dhcp_sendudp: Invalid argument
> Aug 18 06:31:12 amd64-n7 dhcpcd[250]: wm1: dhcp_sendudp: Invalid argument
> Aug 18 07:01:14 amd64-n7 dhcpcd[250]: wm1: dhcp_sendudp: Invalid argument
> Aug 18 07:31:15 amd64-n7 dhcpcd[250]: wm1: dhcp_sendudp: Invalid argument
> Aug 18 08:01:16 amd64-n7 dhcpcd[250]: wm1: dhcp_sendudp: Invalid argument
> Aug 18 08:31:16 amd64-n7 dhcpcd[250]: wm1: dhcp_sendudp: Invalid argument

This error message appeared ever 30 minutes, but it also disappeared
with this patch.

Thanks.


-- 
-----------------------------------------------
                SAITOH Masanobu (msaitoh%execsw.org@localhost
                                 msaitoh%netbsd.org@localhost)


Home | Main Index | Thread Index | Old Index