From 4eff4ace6eb798c499a89252ffee1cda5aef135f Mon Sep 17 00:00:00 2001 From: Amin Ben Ramdhane Date: Mon, 21 Feb 2022 12:39:48 +0100 Subject: [PATCH] Ticket refs #7349: Failed to re-created lan interface --- dmtree/tr181/ip.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dmtree/tr181/ip.c b/dmtree/tr181/ip.c index 79f2d035..1e8db2c5 100644 --- a/dmtree/tr181/ip.c +++ b/dmtree/tr181/ip.c @@ -633,7 +633,7 @@ static int browseIPInterfaceInst(struct dmctx *dmctx, DMNODE *parent_node, void static int browseIPInterfaceIPv4AddressInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance) { struct uci_section *parent_sec = (struct uci_section *)prev_data, *intf_s = NULL, *dmmap_s = NULL; - char *inst = NULL, *ipaddr, *added_by_controller = NULL, *device, buf[32] = {0}; + char *inst = NULL, *ipaddr, *added_by_controller = NULL, *proto = NULL, *device = NULL, buf[32] = {0}; json_object *res = NULL, *ipv4_obj = NULL; struct intf_ip_args curr_intf_ip_args = {0}; @@ -645,6 +645,10 @@ static int browseIPInterfaceIPv4AddressInst(struct dmctx *dmctx, DMNODE *parent_ if (strcmp(section_name(intf_s), section_name(parent_sec)) != 0 && DM_STRCMP(device, buf) != 0) continue; + dmuci_get_value_by_section_string(intf_s, "proto", &proto); + if (DM_STRCMP(proto, "none") == 0) + continue; + dmmap_s = check_dmmap_network_interface_ipv4("dmmap_network_ipv4", "intf_ipv4", section_name(parent_sec), section_name(intf_s)); dmuci_get_value_by_section_string(dmmap_s, "added_by_controller", &added_by_controller);