git: 251439f1a068 - main - ctld: Remove dead code in UCL parsing of hex DSCP values
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 11 Apr 2025 14:03:57 UTC
The branch main has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=251439f1a06867a6baccb274c671b2169c9959fd
commit 251439f1a06867a6baccb274c671b2169c9959fd
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2025-04-11 14:00:39 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2025-04-11 14:00:39 +0000
ctld: Remove dead code in UCL parsing of hex DSCP values
libucl treats strings starting with "0x" as an integer if they do
not contain invalid characters. The code also looks broken as it
only calls strtol if the string exactly matches "0x" without any
trailing characters.
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D49644
---
usr.sbin/ctld/uclparse.cc | 3 ---
1 file changed, 3 deletions(-)
diff --git a/usr.sbin/ctld/uclparse.cc b/usr.sbin/ctld/uclparse.cc
index 05cfcc8df7e7..ccb0b45a5ab1 100644
--- a/usr.sbin/ctld/uclparse.cc
+++ b/usr.sbin/ctld/uclparse.cc
@@ -570,9 +570,6 @@ uclparse_dscp(const char *group_type, const char *pg_name,
return (portal_group_set_dscp(ucl_object_toint(obj)));
key = ucl_object_tostring(obj);
- if (strcmp(key, "0x") == 0)
- return (portal_group_set_dscp(strtol(key + 2, NULL, 16)));
-
if (strcmp(key, "be") == 0 || strcmp(key, "cs0") == 0)
portal_group_set_dscp(IPTOS_DSCP_CS0 >> 2);
else if (strcmp(key, "ef") == 0)