summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2021-07-26 09:22:01 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2021-07-26 09:22:01 +0000
commit1e8613138440584fba694595981337d3bd98e652 (patch)
treefb65f4af421400197f860cc1e570920b12d02acf
parentb485b39d4c102791e8fbf85c99ab2712b06db7b9 (diff)
The SIOCAIFADDR ioctl could lose a race against another process
configuring the same IP. Found the hard way by afresh1
-rw-r--r--sbin/dhcpleased/dhcpleased.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/dhcpleased/dhcpleased.c b/sbin/dhcpleased/dhcpleased.c
index 0e08c20bc0e..f4b2104a11b 100644
--- a/sbin/dhcpleased/dhcpleased.c
+++ b/sbin/dhcpleased/dhcpleased.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhcpleased.c,v 1.16 2021/07/22 18:01:29 stsp Exp $ */
+/* $OpenBSD: dhcpleased.c,v 1.17 2021/07/26 09:22:00 florian Exp $ */
/*
* Copyright (c) 2017, 2021 Florian Obser <florian@openbsd.org>
@@ -692,7 +692,7 @@ configure_interface(struct imsg_configure_interface *imsg)
req_sin_mask->sin_len = sizeof(*req_sin_mask);
req_sin_mask->sin_addr.s_addr = imsg->mask.s_addr;
if (ioctl(ioctl_sock, SIOCAIFADDR, &ifaliasreq) == -1)
- fatal("SIOCAIFADDR");
+ log_warn("SIOCAIFADDR");
}
if (imsg->routes_len > 0)
configure_routes(RTM_ADD, imsg);