提交 68e4e036 编写于 作者: J James Ketrenos 提交者: Jeff Garzik

[PATCH] Changed 802.11 headers to use ieee80211_info_element[0]

Changed 802.11 headers to use ieee80211_info_element as zero sized
array so that sizeof calculations do not account for IE sizes.
Signed-off-by: NJames Ketrenos <jketreno@linux.intel.com>
Signed-off-by: NJeff Garzik <jgarzik@pobox.com>
上级 74079fdc
...@@ -538,7 +538,7 @@ struct ieee80211_authentication { ...@@ -538,7 +538,7 @@ struct ieee80211_authentication {
__le16 algorithm; __le16 algorithm;
__le16 transaction; __le16 transaction;
__le16 status; __le16 status;
struct ieee80211_info_element info_element; struct ieee80211_info_element info_element[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
struct ieee80211_probe_response { struct ieee80211_probe_response {
...@@ -546,14 +546,14 @@ struct ieee80211_probe_response { ...@@ -546,14 +546,14 @@ struct ieee80211_probe_response {
u32 time_stamp[2]; u32 time_stamp[2];
__le16 beacon_interval; __le16 beacon_interval;
__le16 capability; __le16 capability;
struct ieee80211_info_element info_element; struct ieee80211_info_element info_element[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
struct ieee80211_assoc_request_frame { struct ieee80211_assoc_request_frame {
__le16 capability; __le16 capability;
__le16 listen_interval; __le16 listen_interval;
u8 current_ap[ETH_ALEN]; u8 current_ap[ETH_ALEN];
struct ieee80211_info_element info_element; struct ieee80211_info_element info_element[0];
} __attribute__ ((packed)); } __attribute__ ((packed));
struct ieee80211_assoc_response_frame { struct ieee80211_assoc_response_frame {
...@@ -561,7 +561,7 @@ struct ieee80211_assoc_response_frame { ...@@ -561,7 +561,7 @@ struct ieee80211_assoc_response_frame {
__le16 capability; __le16 capability;
__le16 status; __le16 status;
__le16 aid; __le16 aid;
struct ieee80211_info_element info_element; /* supported rates */ struct ieee80211_info_element info_element[0]; /* supported rates */
} __attribute__ ((packed)); } __attribute__ ((packed));
struct ieee80211_txb { struct ieee80211_txb {
......
...@@ -822,7 +822,7 @@ static inline int ieee80211_network_init(struct ieee80211_device *ieee, struct i ...@@ -822,7 +822,7 @@ static inline int ieee80211_network_init(struct ieee80211_device *ieee, struct i
network->wpa_ie_len = 0; network->wpa_ie_len = 0;
network->rsn_ie_len = 0; network->rsn_ie_len = 0;
info_element = &beacon->info_element; info_element = beacon->info_element;
left = stats->len - ((void *)info_element - (void *)beacon); left = stats->len - ((void *)info_element - (void *)beacon);
while (left >= sizeof(struct ieee80211_info_element_hdr)) { while (left >= sizeof(struct ieee80211_info_element_hdr)) {
if (sizeof(struct ieee80211_info_element_hdr) + if (sizeof(struct ieee80211_info_element_hdr) +
...@@ -1050,7 +1050,7 @@ static inline void ieee80211_process_probe_response(struct ieee80211_device ...@@ -1050,7 +1050,7 @@ static inline void ieee80211_process_probe_response(struct ieee80211_device
struct ieee80211_network *target; struct ieee80211_network *target;
struct ieee80211_network *oldest = NULL; struct ieee80211_network *oldest = NULL;
#ifdef CONFIG_IEEE80211_DEBUG #ifdef CONFIG_IEEE80211_DEBUG
struct ieee80211_info_element *info_element = &beacon->info_element; struct ieee80211_info_element *info_element = beacon->info_element;
#endif #endif
unsigned long flags; unsigned long flags;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册