From b0167f24690f846e7ee03e3cbcabe55f6ad0f409 Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Fri, 10 Mar 2017 12:29:05 +0100 Subject: [PATCH] eapol: Define and use IEEE80211_MAX_DATA_LEN The same constant will be used in multiple places so define it in a header file. --- src/eapol.c | 2 +- src/mpdu.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/eapol.c b/src/eapol.c index 722e04b1..b87c2c95 100644 --- a/src/eapol.c +++ b/src/eapol.c @@ -95,7 +95,7 @@ static bool pae_read(struct l_io *io, void *user_data) struct sockaddr_ll sll; socklen_t sll_len; ssize_t bytes; - uint8_t frame[2304]; /* IEEE Std 802.11 ch. 8.2.3 */ + uint8_t frame[IEEE80211_MAX_DATA_LEN]; memset(&sll, 0, sizeof(sll)); sll_len = sizeof(sll); diff --git a/src/mpdu.h b/src/mpdu.h index 2cbf86f5..a243cec5 100644 --- a/src/mpdu.h +++ b/src/mpdu.h @@ -25,6 +25,9 @@ #include #include +/* Std 802.11, Section 8.2.3 */ +#define IEEE80211_MAX_DATA_LEN 2304 + /* 802.11, Table 8-1 "Valid type and subtype combinations" */ enum mpdu_type { MPDU_TYPE_MANAGEMENT = 0,