summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2020-09-14 09:40:29 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2020-09-14 09:40:29 +0000
commit34027720893775c8b10b9d08339fcf1626af1dee (patch)
treebcbed450b57ba4ee673e4f7f0fe56f69ba0f5155
parent139e241955cb27d736b1e10315759a1be2a37053 (diff)
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));