From 2b9306b0b87758c9ec565f8c0dbbb55e5028b7ff Mon Sep 17 00:00:00 2001 From: John Crispin Date: Mon, 10 Oct 2022 11:14:57 +0200 Subject: [PATCH] hostapd: add uci_section to status Signed-off-by: John Crispin --- .../network/services/hostapd/files/hostapd.sh | 6 ++- .../hostapd/patches/901-cfg-section.patch | 51 +++++++++++++++++++ package/network/services/uhttpd/Makefile | 1 + 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 package/network/services/hostapd/patches/901-cfg-section.patch diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 3ac9e7b590..c308d1d2de 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -392,6 +392,8 @@ hostapd_common_add_bss_config() { config_add_string fils_dhcp config_add_boolean ratelimit + + config_add_string uci_section } hostapd_set_vlan_file() { @@ -627,7 +629,7 @@ hostapd_set_bss_options() { airtime_bss_weight airtime_bss_limit airtime_sta_weight \ multicast_to_unicast_all proxy_arp per_sta_vif \ eap_server eap_user_file ca_cert server_cert private_key private_key_passwd server_id \ - vendor_elements fils + vendor_elements fils uci_section set_default fils 0 set_default isolate 0 @@ -1152,6 +1154,8 @@ hostapd_set_bss_options() { append bss_conf "per_sta_vif=$per_sta_vif" "$N" fi + [ -n "$uci_section" ] && append bss_conf "uci_section=$uci_section" "$N" + json_get_values opts hostapd_bss_options for val in $opts; do append bss_conf "$val" "$N" diff --git a/package/network/services/hostapd/patches/901-cfg-section.patch b/package/network/services/hostapd/patches/901-cfg-section.patch new file mode 100644 index 0000000000..dcfdd658fe --- /dev/null +++ b/package/network/services/hostapd/patches/901-cfg-section.patch @@ -0,0 +1,51 @@ +Index: hostapd-2021-02-20-59e9794c/hostapd/config_file.c +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/hostapd/config_file.c ++++ hostapd-2021-02-20-59e9794c/hostapd/config_file.c +@@ -2366,6 +2366,8 @@ static int hostapd_config_fill(struct ho + return 1; + } + conf->driver = driver; ++ } else if (os_strcmp(buf, "uci_section") == 0) { ++ bss->uci_section = os_strdup(pos); + } else if (os_strcmp(buf, "driver_params") == 0) { + os_free(conf->driver_params); + conf->driver_params = os_strdup(pos); +Index: hostapd-2021-02-20-59e9794c/src/ap/ap_config.h +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/src/ap/ap_config.h ++++ hostapd-2021-02-20-59e9794c/src/ap/ap_config.h +@@ -279,6 +279,7 @@ struct hostapd_bss_config { + char snoop_iface[IFNAMSIZ + 1]; + char vlan_bridge[IFNAMSIZ + 1]; + char wds_bridge[IFNAMSIZ + 1]; ++ char *uci_section; + + char *config_id; + +Index: hostapd-2021-02-20-59e9794c/src/ap/ubus.c +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/src/ap/ubus.c ++++ hostapd-2021-02-20-59e9794c/src/ap/ubus.c +@@ -467,6 +467,9 @@ hostapd_bss_get_status(struct ubus_conte + hapd->iface->cac_started ? hapd->iface->dfs_cac_ms / 1000 - now.sec : 0); + blobmsg_close_table(&b, dfs_table); + ++ if (hapd->conf->uci_section) ++ blobmsg_add_string(&b, "uci_section", hapd->conf->uci_section); ++ + ubus_send_reply(ctx, req, b.head); + + return 0; +Index: hostapd-2021-02-20-59e9794c/src/ap/ap_config.c +=================================================================== +--- hostapd-2021-02-20-59e9794c.orig/src/ap/ap_config.c ++++ hostapd-2021-02-20-59e9794c/src/ap/ap_config.c +@@ -785,6 +785,7 @@ void hostapd_config_free_bss(struct host + os_free(conf->radius_req_attr_sqlite); + os_free(conf->rsn_preauth_interfaces); + os_free(conf->ctrl_interface); ++ os_free(conf->uci_section); + os_free(conf->config_id); + os_free(conf->ca_cert); + os_free(conf->server_cert); diff --git a/package/network/services/uhttpd/Makefile b/package/network/services/uhttpd/Makefile index 0ae076ca8b..a3fd2a84d9 100644 --- a/package/network/services/uhttpd/Makefile +++ b/package/network/services/uhttpd/Makefile @@ -12,6 +12,7 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/uhttpd.git +PKG_MIRROR_HASH:=90f737663d8495b891f0364342efb06f548a82c26ddb1595e42752f7cecdccee PKG_SOURCE_DATE:=2022-06-01 PKG_SOURCE_VERSION:=e3395cd90bed9b7b9fc319e79528fedcc0d947fe PKG_MAINTAINER:=Felix Fietkau -- 2.25.1