diff options
author | Jouni Malinen <jouni@qca.qualcomm.com> | 2015-07-17 15:36:03 (GMT) |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2015-07-17 16:06:48 (GMT) |
commit | 9721b083f4836db1170d4e77cd0d982766d6e4b1 (patch) | |
tree | 2aee7d919aed9ecc944ae0d733f9e0e36a909b65 /src/fst | |
parent | f5f1cc93070bb91b3444191b20e13319135f0a9e (diff) | |
download | hostap-9721b083f4836db1170d4e77cd0d982766d6e4b1.zip hostap-9721b083f4836db1170d4e77cd0d982766d6e4b1.tar.gz hostap-9721b083f4836db1170d4e77cd0d982766d6e4b1.tar.bz2 |
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.
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'src/fst')
-rw-r--r-- | src/fst/fst_group.c | 20 | ||||
-rw-r--r-- | src/fst/fst_internal.h | 3 |
2 files changed, 10 insertions, 13 deletions
diff --git a/src/fst/fst_group.c b/src/fst/fst_group.c index e362aa2..9718e4e 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 8f7b1a7..d5a875f 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; |