ath10k-ct: fixup build issue
[openwrt/staging/xback.git] / package / network / services / hostapd / patches / 701-reload_config_inline.patch
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Fri, 26 May 2023 10:23:59 +0200
3 Subject: [PATCH] Add ucode support, use ucode for the main ubus object #2
4
5 This implements vastly improved dynamic configuration reload support.
6 It can handle configuration changes on individual wifi interfaces, as well
7 as adding/removing interfaces.
8
9 --- a/hostapd/config_file.c
10 +++ b/hostapd/config_file.c
11 @@ -5102,7 +5102,12 @@ struct hostapd_config * hostapd_config_r
12 int errors = 0;
13 size_t i;
14
15 - f = fopen(fname, "r");
16 + if (!strncmp(fname, "data:", 5)) {
17 + f = fmemopen((void *)(fname + 5), strlen(fname + 5), "r");
18 + fname = "<inline>";
19 + } else {
20 + f = fopen(fname, "r");
21 + }
22 if (f == NULL) {
23 wpa_printf(MSG_ERROR, "Could not open configuration file '%s' "
24 "for reading.", fname);
25 --- a/wpa_supplicant/config_file.c
26 +++ b/wpa_supplicant/config_file.c
27 @@ -326,8 +326,13 @@ struct wpa_config * wpa_config_read(cons
28 while (cred_tail && cred_tail->next)
29 cred_tail = cred_tail->next;
30
31 + if (!strncmp(name, "data:", 5)) {
32 + f = fmemopen((void *)(name + 5), strlen(name + 5), "r");
33 + name = "<inline>";
34 + } else {
35 + f = fopen(name, "r");
36 + }
37 wpa_printf(MSG_DEBUG, "Reading configuration file '%s'", name);
38 - f = fopen(name, "r");
39 if (f == NULL) {
40 wpa_printf(MSG_ERROR, "Failed to open config file '%s', "
41 "error: %s", name, strerror(errno));