]> git.ipfire.org Git - thirdparty/hostap.git/blob - src/ap/ieee802_11_auth.c
VLAN: Separate station grouping and uplink configuration
[thirdparty/hostap.git] / src / ap / ieee802_11_auth.c
1 /*
2 * hostapd / IEEE 802.11 authentication (ACL)
3 * Copyright (c) 2003-2012, Jouni Malinen <j@w1.fi>
4 *
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
7 *
8 * Access control list for IEEE 802.11 authentication can uses statically
9 * configured ACL from configuration files or an external RADIUS server.
10 * Results from external RADIUS queries are cached to allow faster
11 * authentication frame processing.
12 */
13
14 #include "utils/includes.h"
15
16 #include "utils/common.h"
17 #include "utils/eloop.h"
18 #include "crypto/sha1.h"
19 #include "radius/radius.h"
20 #include "radius/radius_client.h"
21 #include "hostapd.h"
22 #include "ap_config.h"
23 #include "ap_drv_ops.h"
24 #include "ieee802_11.h"
25 #include "ieee802_1x.h"
26 #include "ieee802_11_auth.h"
27
28 #define RADIUS_ACL_TIMEOUT 30
29
30
31 struct hostapd_cached_radius_acl {
32 struct os_reltime timestamp;
33 macaddr addr;
34 int accepted; /* HOSTAPD_ACL_* */
35 struct hostapd_cached_radius_acl *next;
36 u32 session_timeout;
37 u32 acct_interim_interval;
38 struct vlan_description vlan_id;
39 struct hostapd_sta_wpa_psk_short *psk;
40 char *identity;
41 char *radius_cui;
42 };
43
44
45 struct hostapd_acl_query_data {
46 struct os_reltime timestamp;
47 u8 radius_id;
48 macaddr addr;
49 u8 *auth_msg; /* IEEE 802.11 authentication frame from station */
50 size_t auth_msg_len;
51 struct hostapd_acl_query_data *next;
52 };
53
54
55 #ifndef CONFIG_NO_RADIUS
56 static void hostapd_acl_cache_free_entry(struct hostapd_cached_radius_acl *e)
57 {
58 os_free(e->identity);
59 os_free(e->radius_cui);
60 hostapd_free_psk_list(e->psk);
61 os_free(e);
62 }
63
64
65 static void hostapd_acl_cache_free(struct hostapd_cached_radius_acl *acl_cache)
66 {
67 struct hostapd_cached_radius_acl *prev;
68
69 while (acl_cache) {
70 prev = acl_cache;
71 acl_cache = acl_cache->next;
72 hostapd_acl_cache_free_entry(prev);
73 }
74 }
75
76
77 static void copy_psk_list(struct hostapd_sta_wpa_psk_short **psk,
78 struct hostapd_sta_wpa_psk_short *src)
79 {
80 struct hostapd_sta_wpa_psk_short **copy_to;
81 struct hostapd_sta_wpa_psk_short *copy_from;
82
83 /* Copy PSK linked list */
84 copy_to = psk;
85 copy_from = src;
86 while (copy_from && copy_to) {
87 *copy_to = os_zalloc(sizeof(struct hostapd_sta_wpa_psk_short));
88 if (*copy_to == NULL)
89 break;
90 os_memcpy(*copy_to, copy_from,
91 sizeof(struct hostapd_sta_wpa_psk_short));
92 copy_from = copy_from->next;
93 copy_to = &((*copy_to)->next);
94 }
95 if (copy_to)
96 *copy_to = NULL;
97 }
98
99
100 static int hostapd_acl_cache_get(struct hostapd_data *hapd, const u8 *addr,
101 u32 *session_timeout,
102 u32 *acct_interim_interval,
103 struct vlan_description *vlan_id,
104 struct hostapd_sta_wpa_psk_short **psk,
105 char **identity, char **radius_cui)
106 {
107 struct hostapd_cached_radius_acl *entry;
108 struct os_reltime now;
109
110 os_get_reltime(&now);
111
112 for (entry = hapd->acl_cache; entry; entry = entry->next) {
113 if (os_memcmp(entry->addr, addr, ETH_ALEN) != 0)
114 continue;
115
116 if (os_reltime_expired(&now, &entry->timestamp,
117 RADIUS_ACL_TIMEOUT))
118 return -1; /* entry has expired */
119 if (entry->accepted == HOSTAPD_ACL_ACCEPT_TIMEOUT)
120 if (session_timeout)
121 *session_timeout = entry->session_timeout;
122 if (acct_interim_interval)
123 *acct_interim_interval =
124 entry->acct_interim_interval;
125 if (vlan_id)
126 *vlan_id = entry->vlan_id;
127 copy_psk_list(psk, entry->psk);
128 if (identity) {
129 if (entry->identity)
130 *identity = os_strdup(entry->identity);
131 else
132 *identity = NULL;
133 }
134 if (radius_cui) {
135 if (entry->radius_cui)
136 *radius_cui = os_strdup(entry->radius_cui);
137 else
138 *radius_cui = NULL;
139 }
140 return entry->accepted;
141 }
142
143 return -1;
144 }
145 #endif /* CONFIG_NO_RADIUS */
146
147
148 static void hostapd_acl_query_free(struct hostapd_acl_query_data *query)
149 {
150 if (query == NULL)
151 return;
152 os_free(query->auth_msg);
153 os_free(query);
154 }
155
156
157 #ifndef CONFIG_NO_RADIUS
158 static int hostapd_radius_acl_query(struct hostapd_data *hapd, const u8 *addr,
159 struct hostapd_acl_query_data *query)
160 {
161 struct radius_msg *msg;
162 char buf[128];
163
164 query->radius_id = radius_client_get_id(hapd->radius);
165 msg = radius_msg_new(RADIUS_CODE_ACCESS_REQUEST, query->radius_id);
166 if (msg == NULL)
167 return -1;
168
169 if (radius_msg_make_authenticator(msg) < 0) {
170 wpa_printf(MSG_INFO, "Could not make Request Authenticator");
171 goto fail;
172 }
173
174 os_snprintf(buf, sizeof(buf), RADIUS_ADDR_FORMAT, MAC2STR(addr));
175 if (!radius_msg_add_attr(msg, RADIUS_ATTR_USER_NAME, (u8 *) buf,
176 os_strlen(buf))) {
177 wpa_printf(MSG_DEBUG, "Could not add User-Name");
178 goto fail;
179 }
180
181 if (!radius_msg_add_attr_user_password(
182 msg, (u8 *) buf, os_strlen(buf),
183 hapd->conf->radius->auth_server->shared_secret,
184 hapd->conf->radius->auth_server->shared_secret_len)) {
185 wpa_printf(MSG_DEBUG, "Could not add User-Password");
186 goto fail;
187 }
188
189 if (add_common_radius_attr(hapd, hapd->conf->radius_auth_req_attr,
190 NULL, msg) < 0)
191 goto fail;
192
193 os_snprintf(buf, sizeof(buf), RADIUS_802_1X_ADDR_FORMAT,
194 MAC2STR(addr));
195 if (!radius_msg_add_attr(msg, RADIUS_ATTR_CALLING_STATION_ID,
196 (u8 *) buf, os_strlen(buf))) {
197 wpa_printf(MSG_DEBUG, "Could not add Calling-Station-Id");
198 goto fail;
199 }
200
201 os_snprintf(buf, sizeof(buf), "CONNECT 11Mbps 802.11b");
202 if (!radius_msg_add_attr(msg, RADIUS_ATTR_CONNECT_INFO,
203 (u8 *) buf, os_strlen(buf))) {
204 wpa_printf(MSG_DEBUG, "Could not add Connect-Info");
205 goto fail;
206 }
207
208 if (radius_client_send(hapd->radius, msg, RADIUS_AUTH, addr) < 0)
209 goto fail;
210 return 0;
211
212 fail:
213 radius_msg_free(msg);
214 return -1;
215 }
216 #endif /* CONFIG_NO_RADIUS */
217
218
219 /**
220 * hostapd_check_acl - Check a specified STA against accept/deny ACLs
221 * @hapd: hostapd BSS data
222 * @addr: MAC address of the STA
223 * @vlan_id: Buffer for returning VLAN ID
224 * Returns: HOSTAPD_ACL_ACCEPT, HOSTAPD_ACL_REJECT, or HOSTAPD_ACL_PENDING
225 */
226 int hostapd_check_acl(struct hostapd_data *hapd, const u8 *addr,
227 struct vlan_description *vlan_id)
228 {
229 if (hostapd_maclist_found(hapd->conf->accept_mac,
230 hapd->conf->num_accept_mac, addr, vlan_id))
231 return HOSTAPD_ACL_ACCEPT;
232
233 if (hostapd_maclist_found(hapd->conf->deny_mac,
234 hapd->conf->num_deny_mac, addr, vlan_id))
235 return HOSTAPD_ACL_REJECT;
236
237 if (hapd->conf->macaddr_acl == ACCEPT_UNLESS_DENIED)
238 return HOSTAPD_ACL_ACCEPT;
239 if (hapd->conf->macaddr_acl == DENY_UNLESS_ACCEPTED)
240 return HOSTAPD_ACL_REJECT;
241
242 return HOSTAPD_ACL_PENDING;
243 }
244
245
246 /**
247 * hostapd_allowed_address - Check whether a specified STA can be authenticated
248 * @hapd: hostapd BSS data
249 * @addr: MAC address of the STA
250 * @msg: Authentication message
251 * @len: Length of msg in octets
252 * @session_timeout: Buffer for returning session timeout (from RADIUS)
253 * @acct_interim_interval: Buffer for returning account interval (from RADIUS)
254 * @vlan_id: Buffer for returning VLAN ID
255 * @psk: Linked list buffer for returning WPA PSK
256 * @identity: Buffer for returning identity (from RADIUS)
257 * @radius_cui: Buffer for returning CUI (from RADIUS)
258 * Returns: HOSTAPD_ACL_ACCEPT, HOSTAPD_ACL_REJECT, or HOSTAPD_ACL_PENDING
259 *
260 * The caller is responsible for freeing the returned *identity and *radius_cui
261 * values with os_free().
262 */
263 int hostapd_allowed_address(struct hostapd_data *hapd, const u8 *addr,
264 const u8 *msg, size_t len, u32 *session_timeout,
265 u32 *acct_interim_interval,
266 struct vlan_description *vlan_id,
267 struct hostapd_sta_wpa_psk_short **psk,
268 char **identity, char **radius_cui)
269 {
270 int res;
271
272 if (session_timeout)
273 *session_timeout = 0;
274 if (acct_interim_interval)
275 *acct_interim_interval = 0;
276 if (vlan_id)
277 os_memset(vlan_id, 0, sizeof(*vlan_id));
278 if (psk)
279 *psk = NULL;
280 if (identity)
281 *identity = NULL;
282 if (radius_cui)
283 *radius_cui = NULL;
284
285 res = hostapd_check_acl(hapd, addr, vlan_id);
286 if (res != HOSTAPD_ACL_PENDING)
287 return res;
288
289 if (hapd->conf->macaddr_acl == USE_EXTERNAL_RADIUS_AUTH) {
290 #ifdef CONFIG_NO_RADIUS
291 return HOSTAPD_ACL_REJECT;
292 #else /* CONFIG_NO_RADIUS */
293 struct hostapd_acl_query_data *query;
294
295 /* Check whether ACL cache has an entry for this station */
296 res = hostapd_acl_cache_get(hapd, addr, session_timeout,
297 acct_interim_interval, vlan_id, psk,
298 identity, radius_cui);
299 if (res == HOSTAPD_ACL_ACCEPT ||
300 res == HOSTAPD_ACL_ACCEPT_TIMEOUT)
301 return res;
302 if (res == HOSTAPD_ACL_REJECT)
303 return HOSTAPD_ACL_REJECT;
304
305 query = hapd->acl_queries;
306 while (query) {
307 if (os_memcmp(query->addr, addr, ETH_ALEN) == 0) {
308 /* pending query in RADIUS retransmit queue;
309 * do not generate a new one */
310 if (identity) {
311 os_free(*identity);
312 *identity = NULL;
313 }
314 if (radius_cui) {
315 os_free(*radius_cui);
316 *radius_cui = NULL;
317 }
318 return HOSTAPD_ACL_PENDING;
319 }
320 query = query->next;
321 }
322
323 if (!hapd->conf->radius->auth_server)
324 return HOSTAPD_ACL_REJECT;
325
326 /* No entry in the cache - query external RADIUS server */
327 query = os_zalloc(sizeof(*query));
328 if (query == NULL) {
329 wpa_printf(MSG_ERROR, "malloc for query data failed");
330 return HOSTAPD_ACL_REJECT;
331 }
332 os_get_reltime(&query->timestamp);
333 os_memcpy(query->addr, addr, ETH_ALEN);
334 if (hostapd_radius_acl_query(hapd, addr, query)) {
335 wpa_printf(MSG_DEBUG, "Failed to send Access-Request "
336 "for ACL query.");
337 hostapd_acl_query_free(query);
338 return HOSTAPD_ACL_REJECT;
339 }
340
341 query->auth_msg = os_malloc(len);
342 if (query->auth_msg == NULL) {
343 wpa_printf(MSG_ERROR, "Failed to allocate memory for "
344 "auth frame.");
345 hostapd_acl_query_free(query);
346 return HOSTAPD_ACL_REJECT;
347 }
348 os_memcpy(query->auth_msg, msg, len);
349 query->auth_msg_len = len;
350 query->next = hapd->acl_queries;
351 hapd->acl_queries = query;
352
353 /* Queued data will be processed in hostapd_acl_recv_radius()
354 * when RADIUS server replies to the sent Access-Request. */
355 return HOSTAPD_ACL_PENDING;
356 #endif /* CONFIG_NO_RADIUS */
357 }
358
359 return HOSTAPD_ACL_REJECT;
360 }
361
362
363 #ifndef CONFIG_NO_RADIUS
364 static void hostapd_acl_expire_cache(struct hostapd_data *hapd,
365 struct os_reltime *now)
366 {
367 struct hostapd_cached_radius_acl *prev, *entry, *tmp;
368
369 prev = NULL;
370 entry = hapd->acl_cache;
371
372 while (entry) {
373 if (os_reltime_expired(now, &entry->timestamp,
374 RADIUS_ACL_TIMEOUT)) {
375 wpa_printf(MSG_DEBUG, "Cached ACL entry for " MACSTR
376 " has expired.", MAC2STR(entry->addr));
377 if (prev)
378 prev->next = entry->next;
379 else
380 hapd->acl_cache = entry->next;
381 hostapd_drv_set_radius_acl_expire(hapd, entry->addr);
382 tmp = entry;
383 entry = entry->next;
384 hostapd_acl_cache_free_entry(tmp);
385 continue;
386 }
387
388 prev = entry;
389 entry = entry->next;
390 }
391 }
392
393
394 static void hostapd_acl_expire_queries(struct hostapd_data *hapd,
395 struct os_reltime *now)
396 {
397 struct hostapd_acl_query_data *prev, *entry, *tmp;
398
399 prev = NULL;
400 entry = hapd->acl_queries;
401
402 while (entry) {
403 if (os_reltime_expired(now, &entry->timestamp,
404 RADIUS_ACL_TIMEOUT)) {
405 wpa_printf(MSG_DEBUG, "ACL query for " MACSTR
406 " has expired.", MAC2STR(entry->addr));
407 if (prev)
408 prev->next = entry->next;
409 else
410 hapd->acl_queries = entry->next;
411
412 tmp = entry;
413 entry = entry->next;
414 hostapd_acl_query_free(tmp);
415 continue;
416 }
417
418 prev = entry;
419 entry = entry->next;
420 }
421 }
422
423
424 /**
425 * hostapd_acl_expire - ACL cache expiration callback
426 * @hapd: struct hostapd_data *
427 */
428 void hostapd_acl_expire(struct hostapd_data *hapd)
429 {
430 struct os_reltime now;
431
432 os_get_reltime(&now);
433 hostapd_acl_expire_cache(hapd, &now);
434 hostapd_acl_expire_queries(hapd, &now);
435 }
436
437
438 static void decode_tunnel_passwords(struct hostapd_data *hapd,
439 const u8 *shared_secret,
440 size_t shared_secret_len,
441 struct radius_msg *msg,
442 struct radius_msg *req,
443 struct hostapd_cached_radius_acl *cache)
444 {
445 int passphraselen;
446 char *passphrase, *strpassphrase;
447 size_t i;
448 struct hostapd_sta_wpa_psk_short *psk;
449
450 /*
451 * Decode all tunnel passwords as PSK and save them into a linked list.
452 */
453 for (i = 0; ; i++) {
454 passphrase = radius_msg_get_tunnel_password(
455 msg, &passphraselen, shared_secret, shared_secret_len,
456 req, i);
457 /*
458 * Passphrase is NULL iff there is no i-th Tunnel-Password
459 * attribute in msg.
460 */
461 if (passphrase == NULL)
462 break;
463 /*
464 * passphrase does not contain the NULL termination.
465 * Add it here as pbkdf2_sha1() requires it.
466 */
467 strpassphrase = os_zalloc(passphraselen + 1);
468 psk = os_zalloc(sizeof(struct hostapd_sta_wpa_psk_short));
469 if (strpassphrase && psk) {
470 os_memcpy(strpassphrase, passphrase, passphraselen);
471 pbkdf2_sha1(strpassphrase,
472 hapd->conf->ssid.ssid,
473 hapd->conf->ssid.ssid_len, 4096,
474 psk->psk, PMK_LEN);
475 psk->next = cache->psk;
476 cache->psk = psk;
477 psk = NULL;
478 }
479 os_free(strpassphrase);
480 os_free(psk);
481 os_free(passphrase);
482 }
483 }
484
485
486 /**
487 * hostapd_acl_recv_radius - Process incoming RADIUS Authentication messages
488 * @msg: RADIUS response message
489 * @req: RADIUS request message
490 * @shared_secret: RADIUS shared secret
491 * @shared_secret_len: Length of shared_secret in octets
492 * @data: Context data (struct hostapd_data *)
493 * Returns: RADIUS_RX_PROCESSED if RADIUS message was a reply to ACL query (and
494 * was processed here) or RADIUS_RX_UNKNOWN if not.
495 */
496 static RadiusRxResult
497 hostapd_acl_recv_radius(struct radius_msg *msg, struct radius_msg *req,
498 const u8 *shared_secret, size_t shared_secret_len,
499 void *data)
500 {
501 struct hostapd_data *hapd = data;
502 struct hostapd_acl_query_data *query, *prev;
503 struct hostapd_cached_radius_acl *cache;
504 struct radius_hdr *hdr = radius_msg_get_hdr(msg);
505
506 query = hapd->acl_queries;
507 prev = NULL;
508 while (query) {
509 if (query->radius_id == hdr->identifier)
510 break;
511 prev = query;
512 query = query->next;
513 }
514 if (query == NULL)
515 return RADIUS_RX_UNKNOWN;
516
517 wpa_printf(MSG_DEBUG, "Found matching Access-Request for RADIUS "
518 "message (id=%d)", query->radius_id);
519
520 if (radius_msg_verify(msg, shared_secret, shared_secret_len, req, 0)) {
521 wpa_printf(MSG_INFO, "Incoming RADIUS packet did not have "
522 "correct authenticator - dropped\n");
523 return RADIUS_RX_INVALID_AUTHENTICATOR;
524 }
525
526 if (hdr->code != RADIUS_CODE_ACCESS_ACCEPT &&
527 hdr->code != RADIUS_CODE_ACCESS_REJECT) {
528 wpa_printf(MSG_DEBUG, "Unknown RADIUS message code %d to ACL "
529 "query", hdr->code);
530 return RADIUS_RX_UNKNOWN;
531 }
532
533 /* Insert Accept/Reject info into ACL cache */
534 cache = os_zalloc(sizeof(*cache));
535 if (cache == NULL) {
536 wpa_printf(MSG_DEBUG, "Failed to add ACL cache entry");
537 goto done;
538 }
539 os_get_reltime(&cache->timestamp);
540 os_memcpy(cache->addr, query->addr, sizeof(cache->addr));
541 if (hdr->code == RADIUS_CODE_ACCESS_ACCEPT) {
542 u8 *buf;
543 size_t len;
544
545 if (radius_msg_get_attr_int32(msg, RADIUS_ATTR_SESSION_TIMEOUT,
546 &cache->session_timeout) == 0)
547 cache->accepted = HOSTAPD_ACL_ACCEPT_TIMEOUT;
548 else
549 cache->accepted = HOSTAPD_ACL_ACCEPT;
550
551 if (radius_msg_get_attr_int32(
552 msg, RADIUS_ATTR_ACCT_INTERIM_INTERVAL,
553 &cache->acct_interim_interval) == 0 &&
554 cache->acct_interim_interval < 60) {
555 wpa_printf(MSG_DEBUG, "Ignored too small "
556 "Acct-Interim-Interval %d for STA " MACSTR,
557 cache->acct_interim_interval,
558 MAC2STR(query->addr));
559 cache->acct_interim_interval = 0;
560 }
561
562 cache->vlan_id.untagged = radius_msg_get_vlanid(msg);
563 cache->vlan_id.notempty = !!cache->vlan_id.untagged;
564
565 decode_tunnel_passwords(hapd, shared_secret, shared_secret_len,
566 msg, req, cache);
567
568 if (radius_msg_get_attr_ptr(msg, RADIUS_ATTR_USER_NAME,
569 &buf, &len, NULL) == 0) {
570 cache->identity = os_zalloc(len + 1);
571 if (cache->identity)
572 os_memcpy(cache->identity, buf, len);
573 }
574 if (radius_msg_get_attr_ptr(
575 msg, RADIUS_ATTR_CHARGEABLE_USER_IDENTITY,
576 &buf, &len, NULL) == 0) {
577 cache->radius_cui = os_zalloc(len + 1);
578 if (cache->radius_cui)
579 os_memcpy(cache->radius_cui, buf, len);
580 }
581
582 if (hapd->conf->wpa_psk_radius == PSK_RADIUS_REQUIRED &&
583 !cache->psk)
584 cache->accepted = HOSTAPD_ACL_REJECT;
585
586 if (cache->vlan_id.notempty &&
587 !hostapd_vlan_valid(hapd->conf->vlan, &cache->vlan_id)) {
588 hostapd_logger(hapd, query->addr,
589 HOSTAPD_MODULE_RADIUS,
590 HOSTAPD_LEVEL_INFO,
591 "Invalid VLAN %d received from RADIUS server",
592 cache->vlan_id.untagged);
593 os_memset(&cache->vlan_id, 0, sizeof(cache->vlan_id));
594 }
595 if (hapd->conf->ssid.dynamic_vlan == DYNAMIC_VLAN_REQUIRED &&
596 !cache->vlan_id.notempty)
597 cache->accepted = HOSTAPD_ACL_REJECT;
598 } else
599 cache->accepted = HOSTAPD_ACL_REJECT;
600 cache->next = hapd->acl_cache;
601 hapd->acl_cache = cache;
602
603 #ifdef CONFIG_DRIVER_RADIUS_ACL
604 hostapd_drv_set_radius_acl_auth(hapd, query->addr, cache->accepted,
605 cache->session_timeout);
606 #else /* CONFIG_DRIVER_RADIUS_ACL */
607 #ifdef NEED_AP_MLME
608 /* Re-send original authentication frame for 802.11 processing */
609 wpa_printf(MSG_DEBUG, "Re-sending authentication frame after "
610 "successful RADIUS ACL query");
611 ieee802_11_mgmt(hapd, query->auth_msg, query->auth_msg_len, NULL);
612 #endif /* NEED_AP_MLME */
613 #endif /* CONFIG_DRIVER_RADIUS_ACL */
614
615 done:
616 if (prev == NULL)
617 hapd->acl_queries = query->next;
618 else
619 prev->next = query->next;
620
621 hostapd_acl_query_free(query);
622
623 return RADIUS_RX_PROCESSED;
624 }
625 #endif /* CONFIG_NO_RADIUS */
626
627
628 /**
629 * hostapd_acl_init: Initialize IEEE 802.11 ACL
630 * @hapd: hostapd BSS data
631 * Returns: 0 on success, -1 on failure
632 */
633 int hostapd_acl_init(struct hostapd_data *hapd)
634 {
635 #ifndef CONFIG_NO_RADIUS
636 if (radius_client_register(hapd->radius, RADIUS_AUTH,
637 hostapd_acl_recv_radius, hapd))
638 return -1;
639 #endif /* CONFIG_NO_RADIUS */
640
641 return 0;
642 }
643
644
645 /**
646 * hostapd_acl_deinit - Deinitialize IEEE 802.11 ACL
647 * @hapd: hostapd BSS data
648 */
649 void hostapd_acl_deinit(struct hostapd_data *hapd)
650 {
651 struct hostapd_acl_query_data *query, *prev;
652
653 #ifndef CONFIG_NO_RADIUS
654 hostapd_acl_cache_free(hapd->acl_cache);
655 #endif /* CONFIG_NO_RADIUS */
656
657 query = hapd->acl_queries;
658 while (query) {
659 prev = query;
660 query = query->next;
661 hostapd_acl_query_free(prev);
662 }
663 }
664
665
666 void hostapd_free_psk_list(struct hostapd_sta_wpa_psk_short *psk)
667 {
668 while (psk) {
669 struct hostapd_sta_wpa_psk_short *prev = psk;
670 psk = psk->next;
671 os_free(prev);
672 }
673 }