Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Nov 2014 23:35:29 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 195191] New: [patch] rtadvd(8): rtadvd should retry on NET_RT_IFLIST sysctl failure like getifaddrs
Message-ID:  <bug-195191-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195191

            Bug ID: 195191
           Summary: [patch] rtadvd(8): rtadvd should retry on
                    NET_RT_IFLIST sysctl failure like getifaddrs
           Product: Base System
           Version: 11.0-CURRENT
          Hardware: Any
                OS: Any
            Status: Needs Triage
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: guyyur@gmail.com

Created attachment 149611
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=149611&action=edit
Retry NET_RT_IFLIST sysctl.

rtadvd exits after printing the message:
rtadvd[41840]: <update_ifinfo> sysctl: NET_RT_IFLIST get failed

The NET_RT_IFLIST sysctl required buffer size can change between the request
for the size and the request for the data.
getifaddrs handles this by retrying the sysctl several times.

I copied the comment and looping from lib/libc/net/getifaddrs.c to have rtadvd
behave like getifaddrs.

rtadvd should probably also be changed to not need to call the sysctl for every
message if the required info can be obtained by other means.


Issue replicated in an environment with dhcpcd for DHCPv6-PD giving an address
to a lan interface and a tun interface.
Restarting dhcpcd can sometimes trigger the problem.

dhcpcd adds a global ipv6 addresses and routes to the interfaces triggering
RTM_NEWADDR and RTM_ADD.
rtadvd calls update_ifinfo on RTM_NEWADDR and RTM_ADD.

The likely scenario is:
dhcpcd adds an address for the lan interface.
rtadvd receives RTM_NEWADDR for the lan interface.
rtadvd calls the sysctl to get the required size.
dhcpcd adds an address for the tun interface.
size changed.
rtadvd calls the sysctl to get the data size with small buffer.

-- 
You are receiving this mail because:
You are the assignee for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-195191-8>