Skip to content

extension on a leaf with ipv4-prefix type #2498

@jeremie6wind

Description

@jeremie6wind

Hello,

I ran into this issue when there is an extension in the ipvx-prefix or ipvx-address-and-prefix types.

the type->name in lyplg_type_store_ipv4_address_prefix is null and the strcmp crashes.

Here is a patch to reproduce:

From 6836f69a35ae2ad3fd0a393d4f4afad145808320 Mon Sep 17 00:00:00 2001
From: Jeremie Leska <jeremie.leska@6wind.com>
Date: Wed, 18 Mar 2026 17:36:57 +0100
Subject: [PATCH] extension in ipv4-prefix type

---
 tests/utests/types/inet_types.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/utests/types/inet_types.c b/tests/utests/types/inet_types.c
index c34ac2783d25..2ab2f0c06537 100644
--- a/tests/utests/types/inet_types.c
+++ b/tests/utests/types/inet_types.c
@@ -38,6 +38,7 @@
     "  import ietf-inet-types {\n" \
     "    prefix inet;\n" \
     "  }\n" \
+    "  extension myext;\n" \
     NODES \
     "}\n"
 
@@ -103,7 +104,7 @@ test_data_xml(void **state)
             "leaf l3 {type inet:ip-address-no-zone;}"
             "leaf l4 {type inet:ipv6-address-no-zone;}"
             "leaf l5 {type inet:ip-prefix;}"
-            "leaf l6 {type inet:ipv4-prefix;}"
+            "leaf l6 {type inet:ipv4-prefix{pref:myext;}}"
             "leaf l7 {type inet:ipv6-prefix;}");
     UTEST_ADD_MODULE(schema, LYS_IN_YANG, NULL, NULL);
 
-- 
2.39.2

Thank you
Best regards
Jeremie

Metadata

Metadata

Assignees

No one assigned

    Labels

    is:bugBug description.status:completedFrom the developer perspective, the issue was solved (bug fixed, question answered,...)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions