From 77d29c9dc0226faa9374ca25fba8dc642c99f303 Mon Sep 17 00:00:00 2001 From: Markus Stockhausen Date: Tue, 28 Jun 2022 10:54:48 +0200 Subject: [PATCH] rpcd-mod-luci: update filter for rpc_luci_get_network_devices When kernel bonding module is loaded it will create a special file /sys/class/net/bonding_masters. This is no network device. Filter it out for getNetworkDevices() call. Signed-off-by: Markus Stockhausen --- libs/rpcd-mod-luci/src/luci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/rpcd-mod-luci/src/luci.c b/libs/rpcd-mod-luci/src/luci.c index ff656ec212..131180a750 100644 --- a/libs/rpcd-mod-luci/src/luci.c +++ b/libs/rpcd-mod-luci/src/luci.c @@ -849,7 +849,7 @@ rpc_luci_get_network_devices(struct ubus_context *ctx, if (e == NULL) break; - if (strcmp(e->d_name, ".") && strcmp(e->d_name, "..")) + if (e->d_type != DT_DIR && e->d_type != DT_REG) rpc_luci_parse_network_device_sys(e->d_name, ifaddr); }