summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/recallocarray.c
diff options
context:
space:
mode:
authorflorian <florian@openbsd.org>2021-03-17 15:24:04 +0000
committerflorian <florian@openbsd.org>2021-03-17 15:24:04 +0000
commit1bbf741cd250344ed5c1a069b3c7e46ee0536216 (patch)
treeb02afcee7c5726f63aa9d41b5cb9243846cef962 /lib/libc/stdlib/recallocarray.c
parentUse correct rdomain when adding/deleting routes (diff)
downloadwireguard-openbsd-1bbf741cd250344ed5c1a069b3c7e46ee0536216.tar.xz
wireguard-openbsd-1bbf741cd250344ed5c1a069b3c7e46ee0536216.zip
Split off init_ifaces from update_iface. init_ifaces discovers the
state of the machine on startup using ioctl(2) and getifaddrs(3). We can then update this state with information provided by route messages. We still need getifaddrs(3) to check if the layer 2 address has changed. This simplifies error handling (what should we do if ioctl(2) fails?), reduces kernel round trips (no need to ask the kernel again for information RTM_IFINFO provided already) and prevents a theoretical race between RTM_IFINFO and getaddrinfo(3). In a fast link state UP -> DOWN -> UP transition RTM_IFINFO informs us that the link went down but we were not using this information but rather looked at getifaddrs(3) information which might see the link as already up again. We would then do nothing while we should try to get a new lease. By storing all interface information in the frontend process we can skip imsgs to the engine process if we get an RTM_IFINFO without relevant changes for us.
Diffstat (limited to 'lib/libc/stdlib/recallocarray.c')
0 files changed, 0 insertions, 0 deletions