From 4bba3f27890e5efeb690080d35ccec6061872dcf Mon Sep 17 00:00:00 2001 From: claudio Date: Thu, 14 Dec 2023 11:10:19 +0000 Subject: [PATCH] Use imsg_get_fd() to access the file descriptor passed in the imsg. OK tb@ --- usr.sbin/ldpd/lde.c | 4 ++-- usr.sbin/ldpd/ldpe.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/usr.sbin/ldpd/lde.c b/usr.sbin/ldpd/lde.c index 4eb4c08f75c..1f41a59d6d9 100644 --- a/usr.sbin/ldpd/lde.c +++ b/usr.sbin/ldpd/lde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lde.c,v 1.76 2023/03/08 04:43:13 guenther Exp $ */ +/* $OpenBSD: lde.c,v 1.77 2023/12/14 11:10:19 claudio Exp $ */ /* * Copyright (c) 2013, 2016 Renato Westphal @@ -452,7 +452,7 @@ lde_dispatch_parent(int fd, short event, void *bula) "to ldpe", __func__); break; } - if ((fd = imsg.fd) == -1) { + if ((fd = imsg_get_fd(&imsg)) == -1) { log_warnx("%s: expected to receive imsg fd to " "ldpe but didn't receive any", __func__); break; diff --git a/usr.sbin/ldpd/ldpe.c b/usr.sbin/ldpd/ldpe.c index 1e7fde78339..b69ec638149 100644 --- a/usr.sbin/ldpd/ldpe.c +++ b/usr.sbin/ldpd/ldpe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldpe.c,v 1.81 2023/03/08 04:43:13 guenther Exp $ */ +/* $OpenBSD: ldpe.c,v 1.82 2023/12/14 11:10:19 claudio Exp $ */ /* * Copyright (c) 2013, 2016 Renato Westphal @@ -296,7 +296,7 @@ ldpe_dispatch_main(int fd, short event, void *bula) "to lde", __func__); break; } - if ((fd = imsg.fd) == -1) { + if ((fd = imsg_get_fd(&imsg)) == -1) { log_warnx("%s: expected to receive imsg fd to " "lde but didn't receive any", __func__); break; @@ -340,13 +340,13 @@ ldpe_dispatch_main(int fd, short event, void *bula) switch (*socket_type) { case LDP_SOCKET_DISC: - disc_socket = imsg.fd; + disc_socket = imsg_get_fd(&imsg); break; case LDP_SOCKET_EDISC: - edisc_socket = imsg.fd; + edisc_socket = imsg_get_fd(&imsg); break; case LDP_SOCKET_SESSION: - session_socket = imsg.fd; + session_socket = imsg_get_fd(&imsg); break; } break; -- 2.20.1