aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2007-02-03 17:04:38 (GMT)
committerJouni Malinen <j@w1.fi>2007-02-03 17:04:38 (GMT)
commit1d38742f045ab8222715d60b4b332c80790bde3f (patch)
treeb76cadf7127e04538887056e55de518b911c4ca4 /hostapd
parentc73e5e4745cbf5e80958fc071460a6538608ebff (diff)
downloadhostap-history-1d38742f045ab8222715d60b4b332c80790bde3f.zip
hostap-history-1d38742f045ab8222715d60b4b332c80790bde3f.tar.gz
hostap-history-1d38742f045ab8222715d60b4b332c80790bde3f.tar.bz2
Removed unused variables.
Diffstat (limited to 'hostapd')
-rw-r--r--hostapd/driver_prism54.c14
-rw-r--r--hostapd/eap_aka.c5
-rw-r--r--hostapd/eap_peap.c5
-rw-r--r--hostapd/eap_sim.c5
-rw-r--r--hostapd/eap_tls.c5
-rw-r--r--hostapd/eap_tlv.c7
-rw-r--r--hostapd/eap_ttls.c8
-rw-r--r--hostapd/ieee802_11h.c6
-rw-r--r--hostapd/ieee802_11h.h13
-rw-r--r--hostapd/reconfig.c19
-rw-r--r--hostapd/wme.c5
-rw-r--r--hostapd/wpa.c5
12 files changed, 48 insertions, 49 deletions
diff --git a/hostapd/driver_prism54.c b/hostapd/driver_prism54.c
index e3eb8c9..d1485f1 100644
--- a/hostapd/driver_prism54.c
+++ b/hostapd/driver_prism54.c
@@ -2,6 +2,7 @@
* hostapd / Driver interaction with Prism54 PIMFOR interface
* Copyright (c) 2004, Bell Kin <bell_kin@pek.com.tw>
* based on hostap driver.c, ieee802_11.c
+ * Copyright (c) 2002-2007, Jouni Malinen <jkmaline@cc.hut.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -169,7 +170,7 @@ static int prism54_set_sta_authorized(void *priv, const u8 *addr,
struct prism54_driver_data *drv = priv;
pimdev_hdr *hdr;
char *pos;
- int res;
+
hdr = malloc(sizeof(*hdr) + ETH_ALEN);
if (hdr == NULL)
return -1;
@@ -181,7 +182,7 @@ static int prism54_set_sta_authorized(void *priv, const u8 *addr,
}
pos = (char *) (hdr + 1);
memcpy(pos, addr, ETH_ALEN);
- res = send(drv->pim_sock, hdr, sizeof(*hdr) + ETH_ALEN, 0);
+ send(drv->pim_sock, hdr, sizeof(*hdr) + ETH_ALEN, 0);
prism54_waitpim(priv, hdr->oid, hdr, sizeof(*hdr) + ETH_ALEN, 10);
free(hdr);
return 0;
@@ -313,7 +314,6 @@ static int prism54_init_1x(void *priv)
struct prism54_driver_data *drv = priv;
pimdev_hdr *hdr;
unsigned long *ul;
- int ret;
int blen = sizeof(*hdr) + sizeof(*ul);
hdr = malloc(blen);
@@ -324,22 +324,22 @@ static int prism54_init_1x(void *priv)
hdr->op = htonl(PIMOP_SET);
hdr->oid = htonl(DOT11_OID_EXUNENCRYPTED);
*ul = htonl(DOT11_BOOL_TRUE); /* not accept */
- ret = send(drv->pim_sock, hdr, blen, 0);
+ send(drv->pim_sock, hdr, blen, 0);
prism54_waitpim(priv, DOT11_OID_EXUNENCRYPTED, hdr, blen, 10);
hdr->op = htonl(PIMOP_SET);
hdr->oid = htonl(DOT11_OID_MLMEAUTOLEVEL);
*ul = htonl(DOT11_MLME_EXTENDED);
- ret = send(drv->pim_sock, hdr, blen, 0);
+ send(drv->pim_sock, hdr, blen, 0);
prism54_waitpim(priv, DOT11_OID_MLMEAUTOLEVEL, hdr, blen, 10);
hdr->op = htonl(PIMOP_SET);
hdr->oid = htonl(DOT11_OID_DOT1XENABLE);
*ul = htonl(DOT11_BOOL_TRUE);
- ret = send(drv->pim_sock, hdr, blen, 0);
+ send(drv->pim_sock, hdr, blen, 0);
prism54_waitpim(priv, DOT11_OID_DOT1XENABLE, hdr, blen, 10);
hdr->op = htonl(PIMOP_SET);
hdr->oid = htonl(DOT11_OID_AUTHENABLE);
*ul = htonl(DOT11_AUTH_OS); /* OS */
- ret = send(drv->pim_sock, hdr, blen, 0);
+ send(drv->pim_sock, hdr, blen, 0);
prism54_waitpim(priv, DOT11_OID_AUTHENABLE, hdr, blen, 10);
free(hdr);
return 0;
diff --git a/hostapd/eap_aka.c b/hostapd/eap_aka.c
index 830ed20..379f61c 100644
--- a/hostapd/eap_aka.c
+++ b/hostapd/eap_aka.c
@@ -1,6 +1,6 @@
/*
* hostapd / EAP-AKA (RFC 4187)
- * Copyright (c) 2005-2006, Jouni Malinen <jkmaline@cc.hut.fi>
+ * Copyright (c) 2005-2007, Jouni Malinen <jkmaline@cc.hut.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -271,12 +271,11 @@ static Boolean eap_aka_check(struct eap_sm *sm, void *priv,
struct eap_aka_data *data = priv;
struct eap_hdr *resp;
u8 *pos, subtype;
- size_t len;
resp = (struct eap_hdr *) respData;
pos = (u8 *) (resp + 1);
if (respDataLen < sizeof(*resp) + 4 || *pos != EAP_TYPE_AKA ||
- (len = ntohs(resp->length)) > respDataLen) {
+ (ntohs(resp->length)) > respDataLen) {
wpa_printf(MSG_INFO, "EAP-AKA: Invalid frame");
return TRUE;
}
diff --git a/hostapd/eap_peap.c b/hostapd/eap_peap.c
index e2773ec..24f9917 100644
--- a/hostapd/eap_peap.c
+++ b/hostapd/eap_peap.c
@@ -1,6 +1,6 @@
/*
* hostapd / EAP-PEAP (draft-josefsson-pppext-eap-tls-eap-07.txt)
- * Copyright (c) 2004-2005, Jouni Malinen <jkmaline@cc.hut.fi>
+ * Copyright (c) 2004-2007, Jouni Malinen <jkmaline@cc.hut.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -338,12 +338,11 @@ static Boolean eap_peap_check(struct eap_sm *sm, void *priv,
{
struct eap_hdr *resp;
u8 *pos;
- size_t len;
resp = (struct eap_hdr *) respData;
pos = (u8 *) (resp + 1);
if (respDataLen < sizeof(*resp) + 2 || *pos != EAP_TYPE_PEAP ||
- (len = ntohs(resp->length)) > respDataLen) {
+ (ntohs(resp->length)) > respDataLen) {
wpa_printf(MSG_INFO, "EAP-PEAP: Invalid frame");
return TRUE;
}
diff --git a/hostapd/eap_sim.c b/hostapd/eap_sim.c
index e4b4187..175c8e5 100644
--- a/hostapd/eap_sim.c
+++ b/hostapd/eap_sim.c
@@ -1,6 +1,6 @@
/*
* hostapd / EAP-SIM (RFC 4186)
- * Copyright (c) 2005-2006, Jouni Malinen <jkmaline@cc.hut.fi>
+ * Copyright (c) 2005-2007, Jouni Malinen <jkmaline@cc.hut.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -267,12 +267,11 @@ static Boolean eap_sim_check(struct eap_sm *sm, void *priv,
struct eap_sim_data *data = priv;
struct eap_hdr *resp;
u8 *pos, subtype;
- size_t len;
resp = (struct eap_hdr *) respData;
pos = (u8 *) (resp + 1);
if (respDataLen < sizeof(*resp) + 4 || *pos != EAP_TYPE_SIM ||
- (len = ntohs(resp->length)) > respDataLen) {
+ (ntohs(resp->length)) > respDataLen) {
wpa_printf(MSG_INFO, "EAP-SIM: Invalid frame");
return TRUE;
}
diff --git a/hostapd/eap_tls.c b/hostapd/eap_tls.c
index 8f8f2f3..2dbffaf 100644
--- a/hostapd/eap_tls.c
+++ b/hostapd/eap_tls.c
@@ -1,6 +1,6 @@
/*
* hostapd / EAP-TLS (RFC 2716)
- * Copyright (c) 2004-2006, Jouni Malinen <jkmaline@cc.hut.fi>
+ * Copyright (c) 2004-2007, Jouni Malinen <jkmaline@cc.hut.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -130,12 +130,11 @@ static Boolean eap_tls_check(struct eap_sm *sm, void *priv,
{
struct eap_hdr *resp;
u8 *pos;
- size_t len;
resp = (struct eap_hdr *) respData;
pos = (u8 *) (resp + 1);
if (respDataLen < sizeof(*resp) + 2 || *pos != EAP_TYPE_TLS ||
- (len = ntohs(resp->length)) > respDataLen) {
+ (ntohs(resp->length)) > respDataLen) {
wpa_printf(MSG_INFO, "EAP-TLS: Invalid frame");
return TRUE;
}
diff --git a/hostapd/eap_tlv.c b/hostapd/eap_tlv.c
index af8c2c8..5672c11 100644
--- a/hostapd/eap_tlv.c
+++ b/hostapd/eap_tlv.c
@@ -1,6 +1,6 @@
/*
* hostapd / EAP-TLV (draft-josefsson-pppext-eap-tls-eap-07.txt)
- * Copyright (c) 2004, Jouni Malinen <jkmaline@cc.hut.fi>
+ * Copyright (c) 2004-2007, Jouni Malinen <jkmaline@cc.hut.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -97,12 +97,11 @@ static Boolean eap_tlv_check(struct eap_sm *sm, void *priv,
{
struct eap_hdr *resp;
u8 *pos;
- size_t len;
resp = (struct eap_hdr *) respData;
pos = (u8 *) (resp + 1);
if (respDataLen < sizeof(*resp) + 1 || *pos != EAP_TYPE_TLV ||
- (len = ntohs(resp->length)) > respDataLen) {
+ (ntohs(resp->length)) > respDataLen) {
wpa_printf(MSG_INFO, "EAP-TLV: Invalid frame");
return TRUE;
}
@@ -117,14 +116,12 @@ static void eap_tlv_process(struct eap_sm *sm, void *priv,
struct eap_tlv_data *data = priv;
struct eap_hdr *resp;
u8 *pos;
- int len;
size_t left;
u8 *result_tlv = NULL;
size_t result_tlv_len = 0;
int tlv_type, mandatory, tlv_len;
resp = (struct eap_hdr *) respData;
- len = ntohs(resp->length);
pos = (u8 *) (resp + 1);
/* Parse TLVs */
diff --git a/hostapd/eap_ttls.c b/hostapd/eap_ttls.c
index 4bb3a34..cdd6283 100644
--- a/hostapd/eap_ttls.c
+++ b/hostapd/eap_ttls.c
@@ -1,6 +1,6 @@
/*
* hostapd / EAP-TTLS (draft-ietf-pppext-eap-ttls-05.txt)
- * Copyright (c) 2004-2005, Jouni Malinen <jkmaline@cc.hut.fi>
+ * Copyright (c) 2004-2007, Jouni Malinen <jkmaline@cc.hut.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -652,12 +652,11 @@ static Boolean eap_ttls_check(struct eap_sm *sm, void *priv,
{
struct eap_hdr *resp;
u8 *pos;
- size_t len;
resp = (struct eap_hdr *) respData;
pos = (u8 *) (resp + 1);
if (respDataLen < sizeof(*resp) + 2 || *pos != EAP_TYPE_TTLS ||
- (len = ntohs(resp->length)) > respDataLen) {
+ (ntohs(resp->length)) > respDataLen) {
wpa_printf(MSG_INFO, "EAP-TTLS: Invalid frame");
return TRUE;
}
@@ -866,7 +865,7 @@ static void eap_ttls_process_phase2_mschapv2(struct eap_sm *sm,
size_t challenge_len,
u8 *response, size_t response_len)
{
- u8 *chal, *username, nt_response[24], *pos, *rx_resp, *peer_challenge,
+ u8 *chal, *username, nt_response[24], *rx_resp, *peer_challenge,
*auth_challenge;
size_t username_len, i;
@@ -895,7 +894,6 @@ static void eap_ttls_process_phase2_mschapv2(struct eap_sm *sm,
* (if present). */
username = sm->identity;
username_len = sm->identity_len;
- pos = username;
for (i = 0; i < username_len; i++) {
if (username[i] == '\\') {
username_len -= i + 1;
diff --git a/hostapd/ieee802_11h.c b/hostapd/ieee802_11h.c
index 926a046..e1777bc 100644
--- a/hostapd/ieee802_11h.c
+++ b/hostapd/ieee802_11h.c
@@ -1,6 +1,7 @@
/*
* hostapd / IEEE 802.11h
- * Copyright 2005-2006, Devicescape Software, Inc.
+ * Copyright (c) 2005-2006, Devicescape Software, Inc.
+ * Copyright (c) 2007, Jouni Malinen <jkmaline@cc.hut.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -19,14 +20,13 @@
int hostapd_check_power_cap(struct hostapd_data *hapd, u8 *power, u8 len)
{
- unsigned int min_pwr, max_pwr;
+ unsigned int max_pwr;
if (len < 2) {
HOSTAPD_DEBUG(HOSTAPD_DEBUG_MINIMAL,
"Too short power capability IE\n");
return -1;
}
- min_pwr = power[0];
max_pwr = power[1];
if (max_pwr > hapd->iface->sta_max_power)
return -1;
diff --git a/hostapd/ieee802_11h.h b/hostapd/ieee802_11h.h
index 584540e..796c504 100644
--- a/hostapd/ieee802_11h.h
+++ b/hostapd/ieee802_11h.h
@@ -1,7 +1,16 @@
/*
* hostapd / IEEE 802.11h
- * Copyright 2005-2006, Devicescape Software, Inc.
- * All Rights Reserved.
+ * Copyright (c) 2005-2006, Devicescape Software, Inc.
+ * Copyright (c) 2007, Jouni Malinen <jkmaline@cc.hut.fi>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Alternatively, this software may be distributed under the terms of BSD
+ * license.
+ *
+ * See README and COPYING for more details.
*/
#ifndef IEEE802_11H_H
diff --git a/hostapd/reconfig.c b/hostapd/reconfig.c
index a799ad9..9a3cfe2 100644
--- a/hostapd/reconfig.c
+++ b/hostapd/reconfig.c
@@ -1,9 +1,17 @@
/*
* hostapd / Configuration reloading
- * Copyright 2002-2003, Jouni Malinen <jkmaline@cc.hut.fi>
- * Copyright 2002-2004, Instant802 Networks, Inc.
- * Copyright 2005-2006, Devicescape Software, Inc.
- * All Rights Reserved.
+ * Copyright (c) 2002-2007, Jouni Malinen <jkmaline@cc.hut.fi>
+ * Copyright (c) 2002-2004, Instant802 Networks, Inc.
+ * Copyright (c) 2005-2006, Devicescape Software, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Alternatively, this software may be distributed under the terms of BSD
+ * license.
+ *
+ * See README and COPYING for more details.
*/
#include "includes.h"
@@ -49,13 +57,10 @@ static int hostapd_config_reload_sta(struct hostapd_data *hapd,
struct sta_info *sta, void *data)
{
struct hostapd_config_change *change = data;
- struct hostapd_config *newconf, *oldconf;
struct hostapd_bss_config *newbss, *oldbss;
int deauth = 0;
u8 reason = WLAN_REASON_PREV_AUTH_NOT_VALID;
- newconf = change->newconf;
- oldconf = change->oldconf;
newbss = change->newbss;
oldbss = change->oldbss;
hapd = change->hapd;
diff --git a/hostapd/wme.c b/hostapd/wme.c
index b29383f..8be740f 100644
--- a/hostapd/wme.c
+++ b/hostapd/wme.c
@@ -77,8 +77,6 @@ u8 * hostapd_eid_wme(struct hostapd_data *hapd, u8 *eid)
int hostapd_eid_wme_valid(struct hostapd_data *hapd, u8 *eid, size_t len)
{
struct wme_information_element *wme;
- u8 *pos;
- size_t left;
wpa_hexdump(MSG_MSGDUMP, "WME IE", eid, len);
@@ -101,9 +99,6 @@ int hostapd_eid_wme_valid(struct hostapd_data *hapd, u8 *eid, size_t len)
return -1;
}
- pos = (u8 *) (wme + 1);
- left = len - sizeof(*wme);
-
return 0;
}
diff --git a/hostapd/wpa.c b/hostapd/wpa.c
index 7b5d2e3..c2987ca 100644
--- a/hostapd/wpa.c
+++ b/hostapd/wpa.c
@@ -1,6 +1,6 @@
/*
* hostapd - IEEE 802.11i-2004 / WPA Authenticator
- * Copyright (c) 2004-2006, Jouni Malinen <jkmaline@cc.hut.fi>
+ * Copyright (c) 2004-2007, Jouni Malinen <jkmaline@cc.hut.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -1052,7 +1052,7 @@ static int wpa_verify_key_mic(struct wpa_ptk *PTK, u8 *data, size_t data_len)
struct ieee802_1x_hdr *hdr;
struct wpa_eapol_key *key;
u16 key_info;
- int type, ret = 0;
+ int ret = 0;
u8 mic[16];
if (data_len < sizeof(*hdr) + sizeof(*key))
@@ -1061,7 +1061,6 @@ static int wpa_verify_key_mic(struct wpa_ptk *PTK, u8 *data, size_t data_len)
hdr = (struct ieee802_1x_hdr *) data;
key = (struct wpa_eapol_key *) (hdr + 1);
key_info = WPA_GET_BE16(key->key_info);
- type = key_info & WPA_KEY_INFO_TYPE_MASK;
memcpy(mic, key->key_mic, 16);
memset(key->key_mic, 0, 16);
if (wpa_eapol_key_mic(PTK->kck, key_info & WPA_KEY_INFO_TYPE_MASK,