The first beacon of SmartCAPWAP
This commit is contained in:
@ -137,7 +137,7 @@ char* capwap_duplicate_string(const char* source) {
|
||||
|
||||
ASSERT(source != NULL);
|
||||
|
||||
clone = capwap_alloc(sizeof(char) * (strlen(source) + 1));
|
||||
clone = capwap_alloc(strlen(source) + 1);
|
||||
strcpy(clone, source);
|
||||
|
||||
return clone;
|
||||
|
@ -124,7 +124,7 @@ void capwap_element_80211_antenna_copy(struct capwap_80211_antenna_element* dst,
|
||||
ASSERT(src != NULL);
|
||||
|
||||
if (dst->selections) {
|
||||
capwap_array_free(dst->selections);
|
||||
capwap_array_resize(dst->selections, 0);
|
||||
} else {
|
||||
dst->selections = capwap_array_create(sizeof(uint8_t), 0, 1);
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ void capwap_get_packet_digest(struct capwap_packet_rxmng* rxmngpacket, struct ca
|
||||
|
||||
MD5Final(&mdContext);
|
||||
|
||||
memcpy(&packetdigest[0], &mdContext.digest[0], sizeof(unsigned char) * 16);
|
||||
memcpy(&packetdigest[0], &mdContext.digest[0], 16);
|
||||
}
|
||||
|
||||
/* Verify duplicate packet */
|
||||
@ -140,7 +140,7 @@ int capwap_recv_retrasmitted_request(struct capwap_dtls* dtls, struct capwap_pac
|
||||
|
||||
/* Check packet digest */
|
||||
capwap_get_packet_digest(rxmngpacket, connection, recvpacketdigest);
|
||||
if (!memcmp(&recvpacketdigest[0], &packetdigest[0], sizeof(unsigned char) * 16)) {
|
||||
if (!memcmp(&recvpacketdigest[0], &packetdigest[0], 16)) {
|
||||
/* Retransmit response */
|
||||
if (!capwap_crypt_sendto_fragmentpacket(dtls, connection->socket.socket[connection->socket.type], txfragmentpacket, &connection->localaddr, &connection->remoteaddr)) {
|
||||
capwap_logging_debug("Warning: error to resend response packet");
|
||||
|
Reference in New Issue
Block a user