summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflorian <florian@openbsd.org>2020-09-14 09:40:28 +0000
committerflorian <florian@openbsd.org>2020-09-14 09:40:28 +0000
commit3ee8adf9ed821bfc55f9549bd80c5ae14c860a0e (patch)
tree3e8f9f141aaf9b274ef76a32198ce8cd536316b9
parentDocument the fact that the maximum size of a font is currently 512 KiB. (diff)
downloadwireguard-openbsd-3ee8adf9ed821bfc55f9549bd80c5ae14c860a0e.tar.xz
wireguard-openbsd-3ee8adf9ed821bfc55f9549bd80c5ae14c860a0e.zip
We might race against removal of an rdomain we just want to handle.
Make setsockopt non-fatal in this case and just ignore the request. Spotted in a diff by reyk for rad(8); discussed with claudio
-rw-r--r--sbin/slaacd/slaacd.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sbin/slaacd/slaacd.c b/sbin/slaacd/slaacd.c
index c048bbd6190..37234b43134 100644
--- a/sbin/slaacd/slaacd.c
+++ b/sbin/slaacd/slaacd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: slaacd.c,v 1.51 2020/09/14 09:07:05 florian Exp $ */
+/* $OpenBSD: slaacd.c,v 1.52 2020/09/14 09:40:28 florian Exp $ */
/*
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
@@ -900,8 +900,12 @@ open_icmp6sock(int rdomain)
fatal("IPV6_RECVHOPLIMIT");
if (setsockopt(icmp6sock, SOL_SOCKET, SO_RTABLE, &rdomain,
- sizeof(rdomain)) == -1)
- fatal("setsockopt SO_RTABLE");
+ sizeof(rdomain)) == -1) {
+ /* we might race against removal of the rdomain */
+ log_warn("setsockopt SO_RTABLE");
+ close(icmp6sock);
+ return;
+ }
main_imsg_compose_frontend(IMSG_ICMP6SOCK, icmp6sock, &rdomain,
sizeof(rdomain));