[PATCH v3 02/16] lpm: restrict name size

Stephen Hemminger
2025-12-05T20:15:57Z

Since LPM uses ring internally with a prefix, limit the
maximum allowed LPM name.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/lpm/rte_lpm.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/lpm/rte_lpm.h b/lib/lpm/rte_lpm.h
index edfe77b458..21a93b7e44 100644
--- a/lib/lpm/rte_lpm.h
+++ b/lib/lpm/rte_lpm.h
@@ -26,7 +26,7 @@ extern "C" {
#endif

/** Max number of characters in LPM name. */
-#define RTE_LPM_NAMESIZE 32
+#define RTE_LPM_NAMESIZE (RTE_RING_NAMESIZE - sizeof("LPM_RCU_") + 1)

/** Maximum depth value possible for IPv4 LPM. */
#define RTE_LPM_MAX_DEPTH 32
--
2.51.0