d39ba2e33b8e90365e6eb7191a91d0111a243372
[openwrt.git] / package / network / services / hostapd / patches / 380-disable_ctrl_iface_mib.patch
1 --- a/hostapd/Makefile
2 +++ b/hostapd/Makefile
3 @@ -163,6 +163,9 @@ endif
4  ifdef CONFIG_NO_CTRL_IFACE
5  CFLAGS += -DCONFIG_NO_CTRL_IFACE
6  else
7 +ifdef CONFIG_CTRL_IFACE_MIB
8 +CFLAGS += -DCONFIG_CTRL_IFACE_MIB
9 +endif
10  OBJS += ctrl_iface.o
11  OBJS += ../src/ap/ctrl_iface_ap.o
12  endif
13 --- a/hostapd/ctrl_iface.c
14 +++ b/hostapd/ctrl_iface.c
15 @@ -1447,6 +1447,7 @@ static void hostapd_ctrl_iface_receive(i
16                                                       reply_size);
17         } else if (os_strcmp(buf, "STATUS-DRIVER") == 0) {
18                 reply_len = hostapd_drv_status(hapd, reply, reply_size);
19 +#ifdef CONFIG_CTRL_IFACE_MIB
20         } else if (os_strcmp(buf, "MIB") == 0) {
21                 reply_len = ieee802_11_get_mib(hapd, reply, reply_size);
22                 if (reply_len >= 0) {
23 @@ -1488,6 +1489,7 @@ static void hostapd_ctrl_iface_receive(i
24         } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
25                 reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply,
26                                                         reply_size);
27 +#endif
28         } else if (os_strcmp(buf, "ATTACH") == 0) {
29                 if (hostapd_ctrl_iface_attach(hapd, &from, fromlen))
30                         reply_len = -1;
31 --- a/wpa_supplicant/Makefile
32 +++ b/wpa_supplicant/Makefile
33 @@ -797,6 +797,9 @@ ifdef CONFIG_WNM
34  OBJS += ../src/ap/wnm_ap.o
35  endif
36  ifdef CONFIG_CTRL_IFACE
37 +ifdef CONFIG_CTRL_IFACE_MIB
38 +CFLAGS += -DCONFIG_CTRL_IFACE_MIB
39 +endif
40  OBJS += ../src/ap/ctrl_iface_ap.o
41  endif
42  
43 --- a/wpa_supplicant/ctrl_iface.c
44 +++ b/wpa_supplicant/ctrl_iface.c
45 @@ -6075,6 +6075,7 @@ char * wpa_supplicant_ctrl_iface_process
46                         reply_len = -1;
47         } else if (os_strncmp(buf, "NOTE ", 5) == 0) {
48                 wpa_printf(MSG_INFO, "NOTE: %s", buf + 5);
49 +#ifdef CONFIG_CTRL_IFACE_MIB
50         } else if (os_strcmp(buf, "MIB") == 0) {
51                 reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size);
52                 if (reply_len >= 0) {
53 @@ -6086,6 +6087,7 @@ char * wpa_supplicant_ctrl_iface_process
54                         else
55                                 reply_len += res;
56                 }
57 +#endif
58         } else if (os_strncmp(buf, "STATUS", 6) == 0) {
59                 reply_len = wpa_supplicant_ctrl_iface_status(
60                         wpa_s, buf + 6, reply, reply_size);
61 @@ -6490,6 +6492,7 @@ char * wpa_supplicant_ctrl_iface_process
62                 reply_len = wpa_supplicant_ctrl_iface_bss(
63                         wpa_s, buf + 4, reply, reply_size);
64  #ifdef CONFIG_AP
65 +#ifdef CONFIG_CTRL_IFACE_MIB
66         } else if (os_strcmp(buf, "STA-FIRST") == 0) {
67                 reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size);
68         } else if (os_strncmp(buf, "STA ", 4) == 0) {
69 @@ -6498,6 +6501,7 @@ char * wpa_supplicant_ctrl_iface_process
70         } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
71                 reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply,
72                                                    reply_size);
73 +#endif
74         } else if (os_strncmp(buf, "DEAUTHENTICATE ", 15) == 0) {
75                 if (ap_ctrl_iface_sta_deauthenticate(wpa_s, buf + 15))
76                         reply_len = -1;
77 --- a/src/ap/ctrl_iface_ap.c
78 +++ b/src/ap/ctrl_iface_ap.c
79 @@ -21,6 +21,7 @@
80  #include "ctrl_iface_ap.h"
81  #include "ap_drv_ops.h"
82  
83 +#ifdef CONFIG_CTRL_IFACE_MIB
84  
85  static int hostapd_get_sta_tx_rx(struct hostapd_data *hapd,
86                                  struct sta_info *sta,
87 @@ -214,6 +215,7 @@ int hostapd_ctrl_iface_sta_next(struct h
88         return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen);
89  }
90  
91 +#endif
92  
93  #ifdef CONFIG_P2P_MANAGER
94  static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype,
95 @@ -524,3 +526,4 @@ int hostapd_parse_csa_settings(const cha
96  
97         return 0;
98  }
99 +
100 --- a/src/ap/ieee802_1x.c
101 +++ b/src/ap/ieee802_1x.c
102 @@ -2124,6 +2124,7 @@ static const char * bool_txt(Boolean boo
103         return bool_val ? "TRUE" : "FALSE";
104  }
105  
106 +#ifdef CONFIG_CTRL_IFACE_MIB
107  
108  int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen)
109  {
110 @@ -2291,6 +2292,7 @@ int ieee802_1x_get_mib_sta(struct hostap
111         return len;
112  }
113  
114 +#endif
115  
116  static void ieee802_1x_finished(struct hostapd_data *hapd,
117                                 struct sta_info *sta, int success,
118 --- a/src/ap/wpa_auth.c
119 +++ b/src/ap/wpa_auth.c
120 @@ -2830,6 +2830,7 @@ static const char * wpa_bool_txt(int boo
121         return bool ? "TRUE" : "FALSE";
122  }
123  
124 +#ifdef CONFIG_CTRL_IFACE_MIB
125  
126  #define RSN_SUITE "%02x-%02x-%02x-%d"
127  #define RSN_SUITE_ARG(s) \
128 @@ -2974,7 +2975,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
129  
130         return len;
131  }
132 -
133 +#endif
134  
135  void wpa_auth_countermeasures_start(struct wpa_authenticator *wpa_auth)
136  {
137 --- a/src/rsn_supp/wpa.c
138 +++ b/src/rsn_supp/wpa.c
139 @@ -1912,6 +1912,8 @@ static u32 wpa_key_mgmt_suite(struct wpa
140  }
141  
142  
143 +#ifdef CONFIG_CTRL_IFACE_MIB
144 +
145  #define RSN_SUITE "%02x-%02x-%02x-%d"
146  #define RSN_SUITE_ARG(s) \
147  ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff
148 @@ -1995,6 +1997,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
149  
150         return (int) len;
151  }
152 +#endif
153  #endif /* CONFIG_CTRL_IFACE */
154  
155