From 07a040677dab9f9b1ccad19c2578b47366daf84e Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Sun, 8 Feb 2026 15:19:54 +0000 Subject: [PATCH] lib: fix handling of missing const type qualifiers. For ISO C23, the functions strstr and strpbrk that return pointers into their input arrays now have definitions as macros that return a pointer to a const-qualified type when the in put argument is a pointer to a const-qualified type. Update to const type for variabkes, as returned string is only used in comparisons which const can be used. Signed-off-by: Rudi Heitbaum --- lib/route/classid.c | 6 ++++-- lib/route/qdisc/netem.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/route/classid.c b/lib/route/classid.c index f5a75f07f..0f7021e70 100644 --- a/lib/route/classid.c +++ b/lib/route/classid.c @@ -153,7 +153,8 @@ char *rtnl_tc_handle2str(uint32_t handle, char *buf, size_t len) */ int rtnl_tc_str2handle(const char *str, uint32_t *res) { - char *colon, *end; + const char *colon; + char *colon2, *end; uint32_t h; int err; @@ -172,7 +173,8 @@ int rtnl_tc_str2handle(const char *str, uint32_t *res) return 0; } - h = strtoul(str, &colon, 16); + h = strtoul(str, &colon2, 16); + colon = colon2; /* MAJ is not a number */ if (colon == str) { diff --git a/lib/route/qdisc/netem.c b/lib/route/qdisc/netem.c index 8ced03404..63298b8d7 100644 --- a/lib/route/qdisc/netem.c +++ b/lib/route/qdisc/netem.c @@ -946,7 +946,7 @@ int rtnl_netem_set_delay_distribution(struct rtnl_qdisc *qdisc, const char *dist char name[NAME_MAX]; char dist_suffix[] = ".dist"; _nl_auto_free int16_t *data = NULL; - char *test_suffix; + const char *test_suffix; /* Check several locations for the dist file */ char *test_path[] = {