summaryrefslogtreecommitdiff
path: root/sbin/iked/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/iked/config.c')
-rw-r--r--sbin/iked/config.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sbin/iked/config.c b/sbin/iked/config.c
index 157aeb44b8e..cc26eeef729 100644
--- a/sbin/iked/config.c
+++ b/sbin/iked/config.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: config.c,v 1.94 2024/01/15 15:29:00 tobhe Exp $ */
+/* $OpenBSD: config.c,v 1.95 2024/01/17 08:25:02 claudio Exp $ */
/*
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
@@ -611,17 +611,17 @@ config_getsocket(struct iked *env, struct imsg *imsg,
{
struct iked_socket *sock, **sock0 = NULL, **sock1 = NULL;
- log_debug("%s: received socket fd %d", __func__, imsg->fd);
-
if ((sock = calloc(1, sizeof(*sock))) == NULL)
fatal("config_getsocket: calloc");
IMSG_SIZE_CHECK(imsg, &sock->sock_addr);
memcpy(&sock->sock_addr, imsg->data, sizeof(sock->sock_addr));
- sock->sock_fd = imsg->fd;
+ sock->sock_fd = imsg_get_fd(imsg);
sock->sock_env = env;
+ log_debug("%s: received socket fd %d", __func__, sock->sock_fd);
+
switch (sock->sock_addr.ss_family) {
case AF_INET:
sock0 = &env->sc_sock4[0];
@@ -665,8 +665,10 @@ config_setpfkey(struct iked *env)
int
config_getpfkey(struct iked *env, struct imsg *imsg)
{
- log_debug("%s: received pfkey fd %d", __func__, imsg->fd);
- pfkey_init(env, imsg->fd);
+ int fd = imsg_get_fd(imsg);
+
+ log_debug("%s: received pfkey fd %d", __func__, fd);
+ pfkey_init(env, fd);
return (0);
}