[Bug 195191] New: [patch] rtadvd(8): rtadvd should retry on NET_RT_IFLIST sysctl failure like getifaddrs

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Nov 19 23:35:29 UTC 2014


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 at FreeBSD.org
          Reporter: guyyur at 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.


More information about the freebsd-bugs mailing list