summaryrefslogtreecommitdiff
path: root/usr.bin/patch
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2021-03-17 15:24:05 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2021-03-17 15:24:05 +0000
commitc504ea0639d258594afd008fd62706ef6bb71b37 (patch)
tree82abd9db7e880f38e5b17dc00eff30f6d8399040 /usr.bin/patch
parent43469e962b06fe0386e69b325a240eab34505969 (diff)
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 'usr.bin/patch')
0 files changed, 0 insertions, 0 deletions