From: Jouni Malinen Date: Sun, 19 Aug 2012 10:46:23 +0000 (+0300) Subject: Remove an extra level of indentation in hostapd_acl_cache_get() X-Git-Tag: hostap_2_0~382 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd1410197e665e7b6103db48079c10cb208b982d;p=thirdparty%2Fhostap.git Remove an extra level of indentation in hostapd_acl_cache_get() Signed-hostap: Jouni Malinen --- diff --git a/src/ap/ieee802_11_auth.c b/src/ap/ieee802_11_auth.c index 76583f5de..ff5066e8e 100644 --- a/src/ap/ieee802_11_auth.c +++ b/src/ap/ieee802_11_auth.c @@ -73,29 +73,26 @@ static int hostapd_acl_cache_get(struct hostapd_data *hapd, const u8 *addr, struct os_time now; os_get_time(&now); - entry = hapd->acl_cache; - while (entry) { - if (os_memcmp(entry->addr, addr, ETH_ALEN) == 0) { - if (now.sec - entry->timestamp > RADIUS_ACL_TIMEOUT) - return -1; /* entry has expired */ - if (entry->accepted == HOSTAPD_ACL_ACCEPT_TIMEOUT) - if (session_timeout) - *session_timeout = - entry->session_timeout; - if (acct_interim_interval) - *acct_interim_interval = - entry->acct_interim_interval; - if (vlan_id) - *vlan_id = entry->vlan_id; - if (psk) - os_memcpy(psk, entry->psk, PMK_LEN); - if (has_psk) - *has_psk = entry->has_psk; - return entry->accepted; - } + for (entry = hapd->acl_cache; entry; entry = entry->next) { + if (os_memcmp(entry->addr, addr, ETH_ALEN) != 0) + continue; - entry = entry->next; + if (now.sec - entry->timestamp > RADIUS_ACL_TIMEOUT) + return -1; /* entry has expired */ + if (entry->accepted == HOSTAPD_ACL_ACCEPT_TIMEOUT) + if (session_timeout) + *session_timeout = entry->session_timeout; + if (acct_interim_interval) + *acct_interim_interval = + entry->acct_interim_interval; + if (vlan_id) + *vlan_id = entry->vlan_id; + if (psk) + os_memcpy(psk, entry->psk, PMK_LEN); + if (has_psk) + *has_psk = entry->has_psk; + return entry->accepted; } return -1;