Use imsg_get_fd() to access the fd passed with the imsg.
authorclaudio <claudio@openbsd.org>
Thu, 14 Dec 2023 09:58:59 +0000 (09:58 +0000)
committerclaudio <claudio@openbsd.org>
Thu, 14 Dec 2023 09:58:59 +0000 (09:58 +0000)
Go ahead florian@ OK tb@

sbin/slaacd/engine.c
sbin/slaacd/frontend.c

index 07b818a..18e716e 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: engine.c,v 1.85 2023/04/30 13:08:40 phessler Exp $    */
+/*     $OpenBSD: engine.c,v 1.86 2023/12/14 09:58:59 claudio Exp $     */
 
 /*
  * Copyright (c) 2017 Florian Obser <florian@openbsd.org>
@@ -661,7 +661,7 @@ engine_dispatch_main(int fd, short event, void *bula)
                                fatalx("%s: received unexpected imsg fd "
                                    "to engine", __func__);
 
-                       if ((fd = imsg.fd) == -1)
+                       if ((fd = imsg_get_fd(&imsg)) == -1)
                                fatalx("%s: expected to receive imsg fd to "
                                   "engine but didn't receive any", __func__);
 
index 24cf5c7..25b6fe2 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: frontend.c,v 1.64 2022/07/12 16:54:59 florian Exp $   */
+/*     $OpenBSD: frontend.c,v 1.65 2023/12/14 09:58:59 claudio Exp $   */
 
 /*
  * Copyright (c) 2017 Florian Obser <florian@openbsd.org>
@@ -314,7 +314,7 @@ frontend_dispatch_main(int fd, short event, void *bula)
                                fatalx("%s: received unexpected imsg fd "
                                    "to frontend", __func__);
 
-                       if ((fd = imsg.fd) == -1)
+                       if ((fd = imsg_get_fd(&imsg)) == -1)
                                fatalx("%s: expected to receive imsg fd to "
                                   "frontend but didn't receive any",
                                   __func__);
@@ -332,7 +332,7 @@ frontend_dispatch_main(int fd, short event, void *bula)
                        event_add(&iev_engine->ev, NULL);
                        break;
                case IMSG_ICMP6SOCK:
-                       if ((icmp6sock = imsg.fd) == -1)
+                       if ((icmp6sock = imsg_get_fd(&imsg)) == -1)
                                fatalx("%s: expected to receive imsg "
                                    "ICMPv6 fd but didn't receive any",
                                    __func__);
@@ -343,7 +343,7 @@ frontend_dispatch_main(int fd, short event, void *bula)
                        set_icmp6sock(icmp6sock, rdomain);
                        break;
                case IMSG_ROUTESOCK:
-                       if ((fd = imsg.fd) == -1)
+                       if ((fd = imsg_get_fd(&imsg)) == -1)
                                fatalx("%s: expected to receive imsg "
                                    "routesocket fd but didn't receive any",
                                    __func__);
@@ -355,7 +355,7 @@ frontend_dispatch_main(int fd, short event, void *bula)
                        break;
 #ifndef        SMALL
                case IMSG_CONTROLFD:
-                       if ((fd = imsg.fd) == -1)
+                       if ((fd = imsg_get_fd(&imsg)) == -1)
                                fatalx("%s: expected to receive imsg "
                                    "control fd but didn't receive any",
                                    __func__);