From 23bf422f9891b04e448ba9d792ffb9f373f5e137 Mon Sep 17 00:00:00 2001 From: Amin Ben Ramdhane Date: Fri, 19 Aug 2022 14:51:18 +0100 Subject: [PATCH] T#8435: Device.Hosts.Host.{i}.Layer1Interface is shown as empty for Ethernet Devices in some cases (cherry picked from commit 5278cabfc34ec1a055dc7c3547ac7066df6b78e8) --- dmtree/tr181/hosts.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dmtree/tr181/hosts.c b/dmtree/tr181/hosts.c index 2f2a702f..89ff7836 100644 --- a/dmtree/tr181/hosts.c +++ b/dmtree/tr181/hosts.c @@ -121,8 +121,14 @@ static int get_HostsHost_Layer1Interface(char *refparam, struct dmctx *ctx, void dmuci_get_value_by_section_string(iface_s, "device", &linker); adm_entry_get_linker_param(ctx, "Device.WiFi.Radio.", linker, value); } - } else + } else { adm_entry_get_linker_param(ctx, "Device.Ethernet.Interface.", linker, value); + if (!(*value) || (*value)[0] == 0) { + struct uci_section *device_s = get_dup_section_in_config_opt("network", "device", "name", linker); + dmuci_get_value_by_section_string(device_s, "ifname", &linker); + adm_entry_get_linker_param(ctx, "Device.Ethernet.Interface.", linker, value); + } + } return 0; }