hand PD_IAs to dhcp6leasectl
authorflorian <florian@openbsd.org>
Thu, 6 Jun 2024 15:15:44 +0000 (15:15 +0000)
committerflorian <florian@openbsd.org>
Thu, 6 Jun 2024 15:15:44 +0000 (15:15 +0000)
sbin/dhcp6leased/dhcp6leased.h
sbin/dhcp6leased/engine.c

index 040cf8c..f285575 100644 (file)
@@ -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 <florian@openbsd.org>
@@ -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;
index 6f9ccf1..1808474 100644 (file)
@@ -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 <florian@openbsd.org>
@@ -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));
 }