summaryrefslogtreecommitdiff
path: root/sbin/slaacd/slaacd.c
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2023-02-15 13:47:01 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2023-02-15 13:47:01 +0000
commit2bb7d10b12a9a7bca6f2a09f7e09878f449669d2 (patch)
treea8f57c91e0973ec1cae42bcb4ed765c383331289 /sbin/slaacd/slaacd.c
parent25fb9f31baf7d1e971775df72097c62b798eb0cb (diff)
Use correct order of arguments for shutdown(2).
Luckily routesock would never be <= 2 so shutdown would always failing with EINVAL and not shutting down random other sockets. The kernel was just uselessly piling up route messages that we were never reading. This mistake first showed up in slaacd(8) and then was copied to the other daemons. Reported & fixed by Josiah Frentsos (jfrent at tilde.team), thanks! OK kn
Diffstat (limited to 'sbin/slaacd/slaacd.c')
-rw-r--r--sbin/slaacd/slaacd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/slaacd/slaacd.c b/sbin/slaacd/slaacd.c
index 816afff65e9..4d1786361f7 100644
--- a/sbin/slaacd/slaacd.c
+++ b/sbin/slaacd/slaacd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: slaacd.c,v 1.67 2022/11/27 15:19:38 kn Exp $ */
+/* $OpenBSD: slaacd.c,v 1.68 2023/02/15 13:47:00 florian Exp $ */
/*
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
@@ -213,7 +213,7 @@ main(int argc, char *argv[])
if ((routesock = socket(AF_ROUTE, SOCK_RAW | SOCK_CLOEXEC |
SOCK_NONBLOCK, AF_INET6)) == -1)
fatal("route socket");
- shutdown(SHUT_RD, routesock);
+ shutdown(routesock, SHUT_RD);
event_init();