aboutsummaryrefslogtreecommitdiffstats
path: root/src/fst
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2015-07-17 18:36:03 +0300
committerLinux Build Service Account <lnxbuild@localhost>2015-10-06 03:19:47 -0600
commit7ce8d79d856dfab8d6d24174a4eb9f3a3dbe4c31 (patch)
treee27c7a050494f2588502b5cae87df32d820ae366 /src/fst
parentd3ec4caaead7a64ea686f7909ca3aa4bfe7368cc (diff)
downloadandroid_external_wpa_supplicant_8-7ce8d79d856dfab8d6d24174a4eb9f3a3dbe4c31.tar.gz
android_external_wpa_supplicant_8-7ce8d79d856dfab8d6d24174a4eb9f3a3dbe4c31.tar.bz2
android_external_wpa_supplicant_8-7ce8d79d856dfab8d6d24174a4eb9f3a3dbe4c31.zip
FST: Remove the IE header len/size macros
These are confusing when the style used with the couple of FST IE checks differs from the rest of hostapd/wpa_supplicant implementation. Change-Id: I2171c0b72e09f3da1e7303da877688f51e012911 Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Git-commit: 9721b083f4836db1170d4e77cd0d982766d6e4b1 Git-repo: git://w1.fi/srv/git/hostap.git CRs-Fixed: 891455
Diffstat (limited to 'src/fst')
-rw-r--r--src/fst/fst_group.c20
-rw-r--r--src/fst/fst_internal.h3
2 files changed, 10 insertions, 13 deletions
diff --git a/src/fst/fst_group.c b/src/fst/fst_group.c
index e362aa2d..9718e4e8 100644
--- a/src/fst/fst_group.c
+++ b/src/fst/fst_group.c
@@ -41,11 +41,11 @@ static void fst_dump_mb_ies(const char *group_id, const char *ifname,
const u8 *p = wpabuf_head(mbies);
size_t s = wpabuf_len(mbies);
- while (s >= offsetof(struct multi_band_ie, mb_ctrl)) {
+ while (s >= 2) {
const struct multi_band_ie *mbie =
(const struct multi_band_ie *) p;
WPA_ASSERT(mbie->eid == WLAN_EID_MULTI_BAND);
- WPA_ASSERT(IE_BUFFER_LENGTH(mbie->len) >= sizeof(*mbie));
+ WPA_ASSERT(2 + mbie->len >= sizeof(*mbie));
fst_printf(MSG_WARNING,
"%s: %s: mb_ctrl=%u band_id=%u op_class=%u chan=%u bssid="
@@ -61,8 +61,8 @@ static void fst_dump_mb_ies(const char *group_id, const char *ifname,
mbie->mb_connection_capability,
mbie->fst_session_tmout);
- p += IE_BUFFER_LENGTH(mbie->len);
- s -= IE_BUFFER_LENGTH(mbie->len);
+ p += 2 + mbie->len;
+ s -= 2 + mbie->len;
}
}
@@ -81,7 +81,7 @@ static void fst_fill_mb_ie(struct wpabuf *buf, const u8 *bssid,
os_memset(mbie, 0, len);
mbie->eid = WLAN_EID_MULTI_BAND;
- mbie->len = len - IE_HEADER_SIZE;
+ mbie->len = len - 2;
#ifdef HOSTAPD
mbie->mb_ctrl = MB_STA_ROLE_AP;
mbie->mb_connection_capability = MB_CONNECTION_CAPABILITY_AP;
@@ -211,7 +211,7 @@ static const u8 * fst_mbie_get_peer_addr(const struct multi_band_ie *mbie)
break;
case MB_STA_ROLE_NON_PCP_NON_AP:
if (mbie->mb_ctrl & MB_CTRL_STA_MAC_PRESENT &&
- IE_BUFFER_LENGTH(mbie->len) >= sizeof(*mbie) + ETH_ALEN)
+ (size_t) 2 + mbie->len >= sizeof(*mbie) + ETH_ALEN)
peer_addr = (const u8 *) &mbie[1];
break;
default:
@@ -229,12 +229,12 @@ fst_group_get_new_iface_by_mbie_and_band_id(struct fst_group *g,
u8 band_id,
u8 *iface_peer_addr)
{
- while (mb_ies_size >= offsetof(struct multi_band_ie, mb_ctrl)) {
+ while (mb_ies_size >= 2) {
const struct multi_band_ie *mbie =
(const struct multi_band_ie *) mb_ies_buff;
if (mbie->eid != WLAN_EID_MULTI_BAND ||
- IE_BUFFER_LENGTH(mbie->len) < sizeof(*mbie))
+ (size_t) 2 + mbie->len < sizeof(*mbie))
break;
if (mbie->band_id == band_id) {
@@ -255,8 +255,8 @@ fst_group_get_new_iface_by_mbie_and_band_id(struct fst_group *g,
break;
}
- mb_ies_buff += IE_BUFFER_LENGTH(mbie->len);
- mb_ies_size -= IE_BUFFER_LENGTH(mbie->len);
+ mb_ies_buff += 2 + mbie->len;
+ mb_ies_size -= 2 + mbie->len;
}
return NULL;
diff --git a/src/fst/fst_internal.h b/src/fst/fst_internal.h
index 8f7b1a7a..d5a875fa 100644
--- a/src/fst/fst_internal.h
+++ b/src/fst/fst_internal.h
@@ -45,9 +45,6 @@ fst_hw_mode_to_band(enum hostapd_hw_mode mode)
}
}
-#define IE_HEADER_SIZE ((u8) (2 * sizeof(u8)))
-#define IE_BUFFER_LENGTH(ie_len_val) ((size_t) ((ie_len_val) + IE_HEADER_SIZE))
-
struct fst_ctrl_handle {
struct fst_ctrl ctrl;
struct dl_list global_ctrls_lentry;