summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-connectivity/kea/files/0001-d2-dhcp-46-radius-dhcpsrv-Avoid-Boost-lexical_cast-o.patch348
-rw-r--r--meta/recipes-connectivity/kea/kea_3.0.1.bb1
2 files changed, 349 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/kea/files/0001-d2-dhcp-46-radius-dhcpsrv-Avoid-Boost-lexical_cast-o.patch b/meta/recipes-connectivity/kea/files/0001-d2-dhcp-46-radius-dhcpsrv-Avoid-Boost-lexical_cast-o.patch
new file mode 100644
index 0000000000..6facc4d32d
--- /dev/null
+++ b/meta/recipes-connectivity/kea/files/0001-d2-dhcp-46-radius-dhcpsrv-Avoid-Boost-lexical_cast-o.patch
@@ -0,0 +1,348 @@
1From e3a0d181a279334c7d7a10c5b09fd1610384101c Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 3 Sep 2025 12:52:51 -0700
4Subject: [PATCH] d2/dhcp[46]/radius/dhcpsrv: Avoid Boost lexical_cast on enums
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Clang with libc++ hardening (-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST)
10rejects Boost's enum trait probe used by `boost::lexical_cast`:
11`boost::type_traits::is_signed/is_unsigned` defines
12`static const T minus_one = (T)-1;`, which is ill-formed for scoped/limited
13enums whose valid range does not include −1 (e.g. enums with values [0..3]).
14When an enum is passed to `lexical_cast<std::string>`, this triggers errors like:
15
16 error: in-class initializer for static data member is not a constant expression
17 ... minus_one = (static_cast<no_cv_t>(-1));
18
19In Kea this surfaced via logging `.arg(enum_value)` and when writing
20`Lease6::type_` to CSV.
21
22This change makes all such call sites avoid `lexical_cast` on enums:
23
24* d2 transactions (`check_exists_*`, `nc_*`, `simple_*`):
25 cast `getDnsUpdateStatus()` to `int` before passing to `.arg(...)`.
26
27* d2 queue manager (`d2_queue_mgr.cc`):
28 cast `mgr_state_` to `int` before logging.
29
30* DHCPv4/6 servers (`dhcp4_srv.cc`, `dhcp6_srv.cc`):
31 cast `dhcp_ddns::NameChangeSender::Result` to `int` before logging.
32
33* RADIUS hook (`radius_accounting.cc`):
34 cast `env.event_` to `int` for the numeric field; we still log the textual
35 form via `eventToText(event_)` in the next argument.
36
37* DHCPv6 CSV writer (`csv_lease_file6.cc`):
38 write `lease_type` using `isc::dhcp::Lease::typeToText(lease.type_)`
39 instead of passing the enum directly. This is human-readable and uses Kea’s
40 own canonical stringifier, while avoiding the Boost enum path entirely.
41
42why:
43
44- Prevents Boost from instantiating enum trait checks that cast −1 to an enum.
45- Unblocks builds with recent Clang/libc++ hardening.
46- Keeps log output stable (numeric codes retained) and improves CSV clarity
47 for lease type by using the provided textual converter.
48
49No functional/ABI changes; only formatting of certain log/CSV values.
50If a downstream consumer expects a numeric `lease_type`, it can be adjusted
51to parse the textual value or the change can be trivially flipped to
52`static_cast<unsigned>(lease.type_)`.
53
54Upstream-Status: Submitted [https://gitlab.isc.org/isc-projects/kea/-/issues/4100]
55Signed-off-by: Khem Raj <raj.khem@gmail.com>
56---
57 src/bin/d2/check_exists_add.cc | 6 +++---
58 src/bin/d2/check_exists_remove.cc | 6 +++---
59 src/bin/d2/d2_queue_mgr.cc | 2 +-
60 src/bin/d2/nc_add.cc | 6 +++---
61 src/bin/d2/nc_remove.cc | 6 +++---
62 src/bin/d2/simple_add.cc | 4 ++--
63 src/bin/d2/simple_add_without_dhcid.cc | 4 ++--
64 src/bin/d2/simple_remove.cc | 4 ++--
65 src/bin/d2/simple_remove_without_dhcid.cc | 4 ++--
66 src/bin/dhcp4/dhcp4_srv.cc | 2 +-
67 src/bin/dhcp6/dhcp6_srv.cc | 2 +-
68 src/hooks/dhcp/radius/radius_accounting.cc | 2 +-
69 src/lib/dhcpsrv/csv_lease_file6.cc | 2 +-
70 13 files changed, 25 insertions(+), 25 deletions(-)
71
72diff --git a/src/bin/d2/check_exists_add.cc b/src/bin/d2/check_exists_add.cc
73index 11bb29f..edfef31 100644
74--- a/src/bin/d2/check_exists_add.cc
75+++ b/src/bin/d2/check_exists_add.cc
76@@ -270,7 +270,7 @@ CheckExistsAddTransaction::addingFwdAddrsHandler() {
77 // bigger is wrong.
78 LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_FORWARD_ADD_BAD_DNSCLIENT_STATUS)
79 .arg(getRequestId())
80- .arg(getDnsUpdateStatus())
81+ .arg(static_cast<int>(getDnsUpdateStatus()))
82 .arg(getNcr()->getFqdn())
83 .arg(getCurrentServer()->toText());
84
85@@ -397,7 +397,7 @@ CheckExistsAddTransaction::replacingFwdAddrsHandler() {
86 LOG_ERROR(d2_to_dns_logger,
87 DHCP_DDNS_FORWARD_REPLACE_BAD_DNSCLIENT_STATUS)
88 .arg(getRequestId())
89- .arg(getDnsUpdateStatus())
90+ .arg(static_cast<int>(getDnsUpdateStatus()))
91 .arg(getNcr()->getFqdn())
92 .arg(getCurrentServer()->toText());
93
94@@ -541,7 +541,7 @@ CheckExistsAddTransaction::replacingRevPtrsHandler() {
95 LOG_ERROR(d2_to_dns_logger,
96 DHCP_DDNS_REVERSE_REPLACE_BAD_DNSCLIENT_STATUS)
97 .arg(getRequestId())
98- .arg(getDnsUpdateStatus())
99+ .arg(static_cast<int>(getDnsUpdateStatus()))
100 .arg(getNcr()->getFqdn())
101 .arg(getCurrentServer()->toText());
102
103diff --git a/src/bin/d2/check_exists_remove.cc b/src/bin/d2/check_exists_remove.cc
104index 8ae5296..8b6b221 100644
105--- a/src/bin/d2/check_exists_remove.cc
106+++ b/src/bin/d2/check_exists_remove.cc
107@@ -268,7 +268,7 @@ CheckExistsRemoveTransaction::removingFwdAddrsHandler() {
108 LOG_ERROR(d2_to_dns_logger,
109 DHCP_DDNS_FORWARD_REMOVE_ADDRS_BAD_DNSCLIENT_STATUS)
110 .arg(getRequestId())
111- .arg(getDnsUpdateStatus())
112+ .arg(static_cast<int>(getDnsUpdateStatus()))
113 .arg(getNcr()->getFqdn())
114 .arg(getCurrentServer()->toText());
115
116@@ -404,7 +404,7 @@ CheckExistsRemoveTransaction::removingFwdRRsHandler() {
117 LOG_ERROR(d2_to_dns_logger,
118 DHCP_DDNS_FORWARD_REMOVE_RRS_BAD_DNSCLIENT_STATUS)
119 .arg(getRequestId())
120- .arg(getDnsUpdateStatus())
121+ .arg(static_cast<int>(getDnsUpdateStatus()))
122 .arg(getNcr()->getFqdn())
123 .arg(getCurrentServer()->toText());
124
125@@ -556,7 +556,7 @@ CheckExistsRemoveTransaction::removingRevPtrsHandler() {
126 LOG_ERROR(d2_to_dns_logger,
127 DHCP_DDNS_REVERSE_REMOVE_BAD_DNSCLIENT_STATUS)
128 .arg(getRequestId())
129- .arg(getDnsUpdateStatus())
130+ .arg(static_cast<int>(getDnsUpdateStatus()))
131 .arg(getNcr()->getFqdn())
132 .arg(getCurrentServer()->toText());
133
134diff --git a/src/bin/d2/d2_queue_mgr.cc b/src/bin/d2/d2_queue_mgr.cc
135index f902b22..effa56b 100644
136--- a/src/bin/d2/d2_queue_mgr.cc
137+++ b/src/bin/d2/d2_queue_mgr.cc
138@@ -78,7 +78,7 @@ D2QueueMgr::operator()(const dhcp_ddns::NameChangeListener::Result result,
139 // this is unexpected so we will treat it as a receive error.
140 // This is most likely an unforeseen programmatic issue.
141 LOG_ERROR(dhcp_to_d2_logger, DHCP_DDNS_QUEUE_MGR_UNEXPECTED_STOP)
142- .arg(mgr_state_);
143+ .arg(static_cast<int>(mgr_state_));
144 stopListening(STOPPED_RECV_ERROR);
145 }
146
147diff --git a/src/bin/d2/nc_add.cc b/src/bin/d2/nc_add.cc
148index 7bffc16..1d17bb2 100644
149--- a/src/bin/d2/nc_add.cc
150+++ b/src/bin/d2/nc_add.cc
151@@ -272,7 +272,7 @@ NameAddTransaction::addingFwdAddrsHandler() {
152 // bigger is wrong.
153 LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_FORWARD_ADD_BAD_DNSCLIENT_STATUS)
154 .arg(getRequestId())
155- .arg(getDnsUpdateStatus())
156+ .arg(static_cast<int>(getDnsUpdateStatus()))
157 .arg(getNcr()->getFqdn())
158 .arg(getCurrentServer()->toText());
159
160@@ -399,7 +399,7 @@ NameAddTransaction::replacingFwdAddrsHandler() {
161 LOG_ERROR(d2_to_dns_logger,
162 DHCP_DDNS_FORWARD_REPLACE_BAD_DNSCLIENT_STATUS)
163 .arg(getRequestId())
164- .arg(getDnsUpdateStatus())
165+ .arg(static_cast<int>(getDnsUpdateStatus()))
166 .arg(getNcr()->getFqdn())
167 .arg(getCurrentServer()->toText());
168
169@@ -542,7 +542,7 @@ NameAddTransaction::replacingRevPtrsHandler() {
170 LOG_ERROR(d2_to_dns_logger,
171 DHCP_DDNS_REVERSE_REPLACE_BAD_DNSCLIENT_STATUS)
172 .arg(getRequestId())
173- .arg(getDnsUpdateStatus())
174+ .arg(static_cast<int>(getDnsUpdateStatus()))
175 .arg(getNcr()->getFqdn())
176 .arg(getCurrentServer()->toText());
177
178diff --git a/src/bin/d2/nc_remove.cc b/src/bin/d2/nc_remove.cc
179index 874e43b..182343c 100644
180--- a/src/bin/d2/nc_remove.cc
181+++ b/src/bin/d2/nc_remove.cc
182@@ -268,7 +268,7 @@ NameRemoveTransaction::removingFwdAddrsHandler() {
183 LOG_ERROR(d2_to_dns_logger,
184 DHCP_DDNS_FORWARD_REMOVE_ADDRS_BAD_DNSCLIENT_STATUS)
185 .arg(getRequestId())
186- .arg(getDnsUpdateStatus())
187+ .arg(static_cast<int>(getDnsUpdateStatus()))
188 .arg(getNcr()->getFqdn())
189 .arg(getCurrentServer()->toText());
190
191@@ -404,7 +404,7 @@ NameRemoveTransaction::removingFwdRRsHandler() {
192 LOG_ERROR(d2_to_dns_logger,
193 DHCP_DDNS_FORWARD_REMOVE_RRS_BAD_DNSCLIENT_STATUS)
194 .arg(getRequestId())
195- .arg(getDnsUpdateStatus())
196+ .arg(static_cast<int>(getDnsUpdateStatus()))
197 .arg(getNcr()->getFqdn())
198 .arg(getCurrentServer()->toText());
199
200@@ -555,7 +555,7 @@ NameRemoveTransaction::removingRevPtrsHandler() {
201 LOG_ERROR(d2_to_dns_logger,
202 DHCP_DDNS_REVERSE_REMOVE_BAD_DNSCLIENT_STATUS)
203 .arg(getRequestId())
204- .arg(getDnsUpdateStatus())
205+ .arg(static_cast<int>(getDnsUpdateStatus()))
206 .arg(getNcr()->getFqdn())
207 .arg(getCurrentServer()->toText());
208
209diff --git a/src/bin/d2/simple_add.cc b/src/bin/d2/simple_add.cc
210index 6113b4d..73aa5b4 100644
211--- a/src/bin/d2/simple_add.cc
212+++ b/src/bin/d2/simple_add.cc
213@@ -259,7 +259,7 @@ SimpleAddTransaction::replacingFwdAddrsHandler() {
214 // bigger is wrong.
215 LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_FORWARD_ADD_BAD_DNSCLIENT_STATUS)
216 .arg(getRequestId())
217- .arg(getDnsUpdateStatus())
218+ .arg(static_cast<int>(getDnsUpdateStatus()))
219 .arg(getNcr()->getFqdn())
220 .arg(getCurrentServer()->toText());
221
222@@ -404,7 +404,7 @@ SimpleAddTransaction::replacingRevPtrsHandler() {
223 LOG_ERROR(d2_to_dns_logger,
224 DHCP_DDNS_REVERSE_REPLACE_BAD_DNSCLIENT_STATUS)
225 .arg(getRequestId())
226- .arg(getDnsUpdateStatus())
227+ .arg(static_cast<int>(getDnsUpdateStatus()))
228 .arg(getNcr()->getFqdn())
229 .arg(getCurrentServer()->toText());
230
231diff --git a/src/bin/d2/simple_add_without_dhcid.cc b/src/bin/d2/simple_add_without_dhcid.cc
232index ccea83a..97918ad 100644
233--- a/src/bin/d2/simple_add_without_dhcid.cc
234+++ b/src/bin/d2/simple_add_without_dhcid.cc
235@@ -260,7 +260,7 @@ SimpleAddWithoutDHCIDTransaction::replacingFwdAddrsHandler() {
236 // bigger is wrong.
237 LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_FORWARD_ADD_BAD_DNSCLIENT_STATUS)
238 .arg(getRequestId())
239- .arg(getDnsUpdateStatus())
240+ .arg(static_cast<int>(getDnsUpdateStatus()))
241 .arg(getNcr()->getFqdn())
242 .arg(getCurrentServer()->toText());
243
244@@ -406,7 +406,7 @@ SimpleAddWithoutDHCIDTransaction::replacingRevPtrsHandler() {
245 LOG_ERROR(d2_to_dns_logger,
246 DHCP_DDNS_REVERSE_REPLACE_BAD_DNSCLIENT_STATUS)
247 .arg(getRequestId())
248- .arg(getDnsUpdateStatus())
249+ .arg(static_cast<int>(getDnsUpdateStatus()))
250 .arg(getNcr()->getFqdn())
251 .arg(getCurrentServer()->toText());
252
253diff --git a/src/bin/d2/simple_remove.cc b/src/bin/d2/simple_remove.cc
254index e1d9a78..14f416b 100644
255--- a/src/bin/d2/simple_remove.cc
256+++ b/src/bin/d2/simple_remove.cc
257@@ -272,7 +272,7 @@ SimpleRemoveTransaction::removingFwdRRsHandler() {
258 LOG_ERROR(d2_to_dns_logger,
259 DHCP_DDNS_FORWARD_REMOVE_RRS_BAD_DNSCLIENT_STATUS)
260 .arg(getRequestId())
261- .arg(getDnsUpdateStatus())
262+ .arg(static_cast<int>(getDnsUpdateStatus()))
263 .arg(getNcr()->getFqdn())
264 .arg(getCurrentServer()->toText());
265
266@@ -423,7 +423,7 @@ SimpleRemoveTransaction::removingRevPtrsHandler() {
267 LOG_ERROR(d2_to_dns_logger,
268 DHCP_DDNS_REVERSE_REMOVE_BAD_DNSCLIENT_STATUS)
269 .arg(getRequestId())
270- .arg(getDnsUpdateStatus())
271+ .arg(static_cast<int>(getDnsUpdateStatus()))
272 .arg(getNcr()->getFqdn())
273 .arg(getCurrentServer()->toText());
274
275diff --git a/src/bin/d2/simple_remove_without_dhcid.cc b/src/bin/d2/simple_remove_without_dhcid.cc
276index 04fe4df..cefdda8 100644
277--- a/src/bin/d2/simple_remove_without_dhcid.cc
278+++ b/src/bin/d2/simple_remove_without_dhcid.cc
279@@ -273,7 +273,7 @@ SimpleRemoveWithoutDHCIDTransaction::removingFwdRRsHandler() {
280 LOG_ERROR(d2_to_dns_logger,
281 DHCP_DDNS_FORWARD_REMOVE_RRS_BAD_DNSCLIENT_STATUS)
282 .arg(getRequestId())
283- .arg(getDnsUpdateStatus())
284+ .arg(static_cast<int>(getDnsUpdateStatus()))
285 .arg(getNcr()->getFqdn())
286 .arg(getCurrentServer()->toText());
287
288@@ -425,7 +425,7 @@ SimpleRemoveWithoutDHCIDTransaction::removingRevPtrsHandler() {
289 LOG_ERROR(d2_to_dns_logger,
290 DHCP_DDNS_REVERSE_REMOVE_BAD_DNSCLIENT_STATUS)
291 .arg(getRequestId())
292- .arg(getDnsUpdateStatus())
293+ .arg(static_cast<int>(getDnsUpdateStatus()))
294 .arg(getNcr()->getFqdn())
295 .arg(getCurrentServer()->toText());
296
297diff --git a/src/bin/dhcp4/dhcp4_srv.cc b/src/bin/dhcp4/dhcp4_srv.cc
298index 0701ed4..471e94c 100644
299--- a/src/bin/dhcp4/dhcp4_srv.cc
300+++ b/src/bin/dhcp4/dhcp4_srv.cc
301@@ -5101,7 +5101,7 @@ Dhcpv4Srv::d2ClientErrorHandler(const
302 dhcp_ddns::NameChangeSender::Result result,
303 dhcp_ddns::NameChangeRequestPtr& ncr) {
304 LOG_ERROR(ddns4_logger, DHCP4_DDNS_REQUEST_SEND_FAILED).
305- arg(result).arg((ncr ? ncr->toText() : " NULL "));
306+ arg(static_cast<int>(result)).arg((ncr ? ncr->toText() : " NULL "));
307 // We cannot communicate with kea-dhcp-ddns, suspend further updates.
308 /// @todo We may wish to revisit this, but for now we will simply turn
309 /// them off.
310diff --git a/src/bin/dhcp6/dhcp6_srv.cc b/src/bin/dhcp6/dhcp6_srv.cc
311index 417960b..818046d 100644
312--- a/src/bin/dhcp6/dhcp6_srv.cc
313+++ b/src/bin/dhcp6/dhcp6_srv.cc
314@@ -5054,7 +5054,7 @@ Dhcpv6Srv::d2ClientErrorHandler(const
315 dhcp_ddns::NameChangeSender::Result result,
316 dhcp_ddns::NameChangeRequestPtr& ncr) {
317 LOG_ERROR(ddns6_logger, DHCP6_DDNS_REQUEST_SEND_FAILED).
318- arg(result).arg((ncr ? ncr->toText() : " NULL "));
319+ arg(static_cast<int>(result)).arg((ncr ? ncr->toText() : " NULL "));
320 // We cannot communicate with kea-dhcp-ddns, suspend further updates.
321 /// @todo We may wish to revisit this, but for now we will simply turn
322 /// them off.
323diff --git a/src/hooks/dhcp/radius/radius_accounting.cc b/src/hooks/dhcp/radius/radius_accounting.cc
324index 30eb07e..31f6d5e 100644
325--- a/src/hooks/dhcp/radius/radius_accounting.cc
326+++ b/src/hooks/dhcp/radius/radius_accounting.cc
327@@ -760,7 +760,7 @@ RadiusAccounting::terminate(RadiusAcctEnv env, int result) {
328 if (result != OK_RC) {
329 LOG_ERROR(radius_logger, RADIUS_ACCOUNTING_ERROR)
330 .arg(env.session_id_)
331- .arg(env.event_)
332+ .arg(static_cast<int>(env.event_))
333 .arg(eventToText(env.event_))
334 .arg(result)
335 .arg(exchangeRCtoText(result));
336diff --git a/src/lib/dhcpsrv/csv_lease_file6.cc b/src/lib/dhcpsrv/csv_lease_file6.cc
337index 830d2e5..a899aef 100644
338--- a/src/lib/dhcpsrv/csv_lease_file6.cc
339+++ b/src/lib/dhcpsrv/csv_lease_file6.cc
340@@ -51,7 +51,7 @@ CSVLeaseFile6::append(const Lease6& lease) {
341 row.writeAt(getColumnIndex("expire"), static_cast<uint64_t>(lease.cltt_) + lease.valid_lft_);
342 row.writeAt(getColumnIndex("subnet_id"), lease.subnet_id_);
343 row.writeAt(getColumnIndex("pref_lifetime"), lease.preferred_lft_);
344- row.writeAt(getColumnIndex("lease_type"), lease.type_);
345+ row.writeAt(getColumnIndex("lease_type"), isc::dhcp::Lease::typeToText(lease.type_));
346 row.writeAt(getColumnIndex("iaid"), lease.iaid_);
347 row.writeAt(getColumnIndex("prefix_len"),
348 static_cast<int>(lease.prefixlen_));
diff --git a/meta/recipes-connectivity/kea/kea_3.0.1.bb b/meta/recipes-connectivity/kea/kea_3.0.1.bb
index 8dc6bdfea8..cc34c05093 100644
--- a/meta/recipes-connectivity/kea/kea_3.0.1.bb
+++ b/meta/recipes-connectivity/kea/kea_3.0.1.bb
@@ -20,6 +20,7 @@ SRC_URI = "http://ftp.isc.org/isc/kea/${PV}/${BP}.tar.xz \
20 file://0001-build-boost-1.89.0-fixes.patch \ 20 file://0001-build-boost-1.89.0-fixes.patch \
21 file://0001-meson-use-a-runtime-safe-interpreter-string.patch \ 21 file://0001-meson-use-a-runtime-safe-interpreter-string.patch \
22 file://0001-mk_cfgrpt.sh-strip-prefixes.patch \ 22 file://0001-mk_cfgrpt.sh-strip-prefixes.patch \
23 file://0001-d2-dhcp-46-radius-dhcpsrv-Avoid-Boost-lexical_cast-o.patch \
23 " 24 "
24SRC_URI[sha256sum] = "ec84fec4bb7f6b9d15a82e755a571e9348eb4d6fbc62bb3f6f1296cd7a24c566" 25SRC_URI[sha256sum] = "ec84fec4bb7f6b9d15a82e755a571e9348eb4d6fbc62bb3f6f1296cd7a24c566"
25 26