From eaef01de758f46967db4f525c21943462e8bac4c Mon Sep 17 00:00:00 2001
From: Jakob Olsson <jakob.olsson@iopsys.eu>
Date: Fri, 18 Feb 2022 17:49:03 +0100
Subject: [PATCH] config: deprecate uci_get_bridge func

---
 src/config.c | 41 -----------------------------------------
 src/config.h |  1 -
 2 files changed, 42 deletions(-)

diff --git a/src/config.c b/src/config.c
index 656a071f2..aaa8cd9ab 100644
--- a/src/config.c
+++ b/src/config.c
@@ -170,47 +170,6 @@ struct uci_package *uci_load_pkg(struct uci_context **ctx, const char *config)
 	return pkg;
 }
 
-/* TODO: causes segfault in disc? */
-char *uci_get_bridge(char *ifname, char *bridge)
-{
-	struct uci_context *ctx;
-	struct uci_package *pkg;
-	struct uci_element *e;
-
-	strncpy(bridge, "lan", 15);
-	return bridge;
-
-	pkg = uci_load_pkg(&ctx, UCI_WIRELESS);
-	if (!pkg)
-		return NULL;
-
-	uci_foreach_element(&pkg->sections, e) {
-		struct uci_section *s = uci_to_section(e);
-		struct uci_option *opt;
-
-		if (strcmp(s->type, UCI_WLAN_IFACE))
-			continue;
-
-		opt = uci_lookup_option(ctx, s,	"ifname");
-		if (!opt || opt->type != UCI_TYPE_STRING)
-			continue;
-
-		if (!strncmp(opt->v.string, ifname, 16))
-			continue;
-
-		opt = uci_lookup_option(ctx, s,	"network");
-		if (!opt || opt->type != UCI_TYPE_STRING)
-			continue;
-
-		strncpy(bridge, opt->v.string, 16);
-		break;
-	}
-
-	uci_unload(ctx, pkg);
-	uci_free_context(ctx);
-	return bridge;
-}
-
 #if 0
 int wifi_get_iface_bssid(char *ifname, uint8_t *bssid)
 {
diff --git a/src/config.h b/src/config.h
index 327fc193a..7451b85ca 100644
--- a/src/config.h
+++ b/src/config.h
@@ -229,7 +229,6 @@ bool uci_reload_services(char *services);
 struct uci_package *uci_load_pkg(struct uci_context **ctx, const char *config);
 int wifi_get_iface_bssid(char *ifname, uint8_t *bssid);
 int wifi_set_iface_bssid(struct netif_bk *bk, uint8_t *bssid);
-char *uci_get_bridge(char *ifname, char *bridge);
 
 /* END TODO */
 struct agent_config_radio *get_agent_config_radio(struct agent_config *c,
-- 
GitLab