replace memcmp on message id struct with direct compare
cset 3761122c
fixed one place, but a few others remained.
This should take care of them all and fix a missing
IE in Add WLAN responses.
This commit is contained in:
parent
6024cc15cf
commit
b0aaaa4436
@ -139,7 +139,7 @@ struct capwap_list_item* capwap_get_message_element(struct capwap_parsed_packet*
|
||||
while (search) {
|
||||
struct capwap_message_element_itemlist* messageelement =
|
||||
(struct capwap_message_element_itemlist*)search->item;
|
||||
if ((id.vendor == messageelement->id.vendor) && (id.type == messageelement->id.type))
|
||||
if (message_element_id_eq(id, messageelement->id))
|
||||
return search;
|
||||
|
||||
/* */
|
||||
|
@ -10,6 +10,9 @@ struct capwap_message_element_id
|
||||
uint16_t type;
|
||||
};
|
||||
|
||||
#define message_element_id_eq(a, b) \
|
||||
(((a).vendor == (b).vendor) && ((a).type == (b).type))
|
||||
|
||||
/* */
|
||||
typedef void* capwap_message_elements_handle;
|
||||
struct capwap_write_message_elements_ops {
|
||||
|
@ -242,7 +242,7 @@ static void receive_ieee80211_wlan_configuration_request(struct capwap_parsed_pa
|
||||
/* Add message element */
|
||||
capwap_packet_txmng_add_message_element(txmngpacket, CAPWAP_ELEMENT_RESULTCODE, &resultcode);
|
||||
if (resultcode.code == CAPWAP_RESULTCODE_SUCCESS &&
|
||||
memcmp(&action, &CAPWAP_ELEMENT_80211_ADD_WLAN, sizeof(CAPWAP_ELEMENT_80211_ADD_WLAN)) == 0)
|
||||
message_element_id_eq(action, CAPWAP_ELEMENT_80211_ADD_WLAN))
|
||||
capwap_packet_txmng_add_message_element(txmngpacket, CAPWAP_ELEMENT_80211_ASSIGN_BSSID, &bssid);
|
||||
|
||||
/* CAPWAP_ELEMENT_VENDORPAYLOAD */ /* TODO */
|
||||
|
@ -195,7 +195,7 @@ static void wtp_radio_setconfiguration_80211(struct capwap_parsed_packet *packet
|
||||
|
||||
/* Parsing only IEEE 802.11 message element */
|
||||
if (!IS_80211_MESSAGE_ELEMENTS(messageelement->id) &&
|
||||
memcmp(&messageelement->id, &CAPWAP_ELEMENT_80211N_RADIO_CONF, sizeof(messageelement->id)) != 0)
|
||||
!message_element_id_eq(messageelement->id, CAPWAP_ELEMENT_80211N_RADIO_CONF))
|
||||
continue;
|
||||
|
||||
ASSERT(messageelements != NULL);
|
||||
@ -255,7 +255,7 @@ static void wtp_radio_setconfiguration_80211(struct capwap_parsed_packet *packet
|
||||
|
||||
/* Parsing only IEEE 802.11 message element */
|
||||
if (!IS_80211_MESSAGE_ELEMENTS(messageelement->id) &&
|
||||
memcmp(&messageelement->id, &CAPWAP_ELEMENT_80211N_RADIO_CONF, sizeof(messageelement->id)) != 0)
|
||||
!message_element_id_eq(messageelement->id, CAPWAP_ELEMENT_80211N_RADIO_CONF))
|
||||
continue;
|
||||
|
||||
ASSERT(messageelements != NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user