aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/ibss_rsn.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2009-01-15 22:56:31 (GMT)
committerJouni Malinen <j@w1.fi>2009-01-15 22:56:31 (GMT)
commite2d492dd08a7b3b56f0d5663676b76ca7b0b063d (patch)
tree53e66c42c24af3e94b201e493683de99e80fbc24 /wpa_supplicant/ibss_rsn.c
parent11ef8d3578f0c57d9503bbee97cbb8e5c0c42207 (diff)
downloadhostap-e2d492dd08a7b3b56f0d5663676b76ca7b0b063d.zip
hostap-e2d492dd08a7b3b56f0d5663676b76ca7b0b063d.tar.gz
hostap-e2d492dd08a7b3b56f0d5663676b76ca7b0b063d.tar.bz2
Implement EAPOL sending callbacks for IBSS RSN
Diffstat (limited to 'wpa_supplicant/ibss_rsn.c')
-rw-r--r--wpa_supplicant/ibss_rsn.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/wpa_supplicant/ibss_rsn.c b/wpa_supplicant/ibss_rsn.c
index 691a84e..6fc1871 100644
--- a/wpa_supplicant/ibss_rsn.c
+++ b/wpa_supplicant/ibss_rsn.c
@@ -15,6 +15,7 @@
#include "includes.h"
#include "common.h"
+#include "l2_packet/l2_packet.h"
#include "wpa_supplicant_i.h"
#include "wpa.h"
#include "wpa_ie.h"
@@ -33,15 +34,17 @@ static void ibss_rsn_free(struct ibss_rsn_peer *peer)
static int supp_ether_send(void *ctx, const u8 *dest, u16 proto, const u8 *buf,
size_t len)
{
- /* struct ibss_rsn_peer *peer = ctx; */
+ struct ibss_rsn_peer *peer = ctx;
+ struct wpa_supplicant *wpa_s = peer->ibss_rsn->wpa_s;
wpa_printf(MSG_DEBUG, "SUPP: %s(dest=" MACSTR " proto=0x%04x "
"len=%lu)",
__func__, MAC2STR(dest), proto, (unsigned long) len);
- /* TODO: send EAPOL frame */
+ if (wpa_s->l2)
+ return l2_packet_send(wpa_s->l2, dest, proto, buf, len);
- return 0;
+ return wpa_drv_send_eapol(wpa_s, dest, proto, buf, len);
}
@@ -181,15 +184,18 @@ static const u8 * auth_get_psk(void *ctx, const u8 *addr, const u8 *prev_psk)
static int auth_send_eapol(void *ctx, const u8 *addr, const u8 *data,
size_t data_len, int encrypt)
{
- /* struct ibss_rsn *ibss_rsn = ctx; */
+ struct ibss_rsn_peer *peer = ctx;
+ struct wpa_supplicant *wpa_s = peer->ibss_rsn->wpa_s;
wpa_printf(MSG_DEBUG, "AUTH: %s(addr=" MACSTR " data_len=%lu "
"encrypt=%d)",
__func__, MAC2STR(addr), (unsigned long) data_len, encrypt);
- /* TODO: send EAPOL frame */
+ if (wpa_s->l2)
+ return l2_packet_send(wpa_s->l2, addr, ETH_P_EAPOL, data,
+ data_len);
- return 0;
+ return wpa_drv_send_eapol(wpa_s, addr, ETH_P_EAPOL, data, data_len);
}
@@ -261,6 +267,7 @@ int ibss_rsn_start(struct ibss_rsn *ibss_rsn, const u8 *addr)
if (peer == NULL)
return -1;
+ peer->ibss_rsn = ibss_rsn;
os_memcpy(peer->addr, addr, ETH_ALEN);
if (ibss_rsn_supp_init(peer, ibss_rsn->wpa_s->own_addr, ibss_rsn->psk)