Date: Tue, 27 Jan 2026 18:44:35 +0000 From: John Baldwin <jhb@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 4054439b47f2 - stable/14 - ctld: Do not remove item from an nvlist while iterating it Message-ID: <69790793.f7e4.1891fbd2@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4054439b47f2b58fa038c3fed8efc6b0be7b624c commit 4054439b47f2b58fa038c3fed8efc6b0be7b624c Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2025-04-11 14:02:48 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2026-01-27 18:15:58 +0000 ctld: Do not remove item from an nvlist while iterating it While here, make use of cnvlist_* to simplify this code. Fixes: d42a73fb6a85 ("ctld: Add a dedicated API between parse.y and the rest of the program") Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D49650 (cherry picked from commit 30020689fb1e5c9549e430bd23600c88e1257697) --- usr.sbin/ctld/kernel.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/usr.sbin/ctld/kernel.cc b/usr.sbin/ctld/kernel.cc index cda84872e269..b1b6e36a5c87 100644 --- a/usr.sbin/ctld/kernel.cc +++ b/usr.sbin/ctld/kernel.cc @@ -41,6 +41,7 @@ #include <sys/param.h> #include <sys/capsicum.h> #include <sys/callout.h> +#include <sys/cnv.h> #include <sys/ioctl.h> #include <sys/linker.h> #include <sys/module.h> @@ -636,12 +637,12 @@ retry_port: NULL) { if (strcmp(key, "file") == 0 || strcmp(key, "dev") == 0) { - cl->l_path = nvlist_take_string(lun->attr_list, - key); + cl->l_path = checked_strdup( + cnvlist_get_string(cookie)); continue; } nvlist_add_string(cl->l_options, key, - nvlist_get_string(lun->attr_list, key)); + cnvlist_get_string(cookie)); error = nvlist_error(cl->l_options); if (error != 0) log_warnc(error, "unable to add CTL lun option "home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69790793.f7e4.1891fbd2>
