From f35103ceccf8536f83b409db370d815808711e75 Mon Sep 17 00:00:00 2001 From: florian Date: Thu, 6 Jun 2024 15:15:44 +0000 Subject: [PATCH] hand PD_IAs to dhcp6leasectl --- sbin/dhcp6leased/dhcp6leased.h | 17 +++++++++-------- sbin/dhcp6leased/engine.c | 3 ++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/sbin/dhcp6leased/dhcp6leased.h b/sbin/dhcp6leased/dhcp6leased.h index 040cf8cbb6b..f2855759db9 100644 --- a/sbin/dhcp6leased/dhcp6leased.h +++ b/sbin/dhcp6leased/dhcp6leased.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dhcp6leased.h,v 1.7 2024/06/05 16:15:47 florian Exp $ */ +/* $OpenBSD: dhcp6leased.h,v 1.8 2024/06/06 15:15:44 florian Exp $ */ /* * Copyright (c) 2017, 2021 Florian Obser @@ -175,6 +175,13 @@ enum imsg_type { IMSG_WRITE_LEASE, }; +struct prefix { + struct in6_addr prefix; + int prefix_len; + uint32_t vltime; + uint32_t pltime; +}; + struct ctl_engine_info { uint32_t if_index; int running; @@ -184,6 +191,7 @@ struct ctl_engine_info { uint32_t lease_time; uint32_t t1; uint32_t t2; + struct prefix pds[MAX_IA]; }; struct iface_pd_conf { @@ -213,13 +221,6 @@ struct dhcp6leased_conf { int rapid_commit; }; -struct prefix { - struct in6_addr prefix; - int prefix_len; - uint32_t vltime; - uint32_t pltime; -}; - struct imsg_ifinfo { uint32_t if_index; int rdomain; diff --git a/sbin/dhcp6leased/engine.c b/sbin/dhcp6leased/engine.c index 6f9ccf16108..180847406b1 100644 --- a/sbin/dhcp6leased/engine.c +++ b/sbin/dhcp6leased/engine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: engine.c,v 1.12 2024/06/05 16:15:47 florian Exp $ */ +/* $OpenBSD: engine.c,v 1.13 2024/06/06 15:15:44 florian Exp $ */ /* * Copyright (c) 2017, 2021, 2024 Florian Obser @@ -572,6 +572,7 @@ send_interface_info(struct dhcp6leased_iface *iface, pid_t pid) cei.lease_time = iface->lease_time; cei.t1 = iface->t1; cei.t2 = iface->t2; + memcpy(&cei.pds, &iface->pds, sizeof(cei.pds)); engine_imsg_compose_frontend(IMSG_CTL_SHOW_INTERFACE_INFO, pid, &cei, sizeof(cei)); } -- 2.20.1