simplify if statement in wtp_dfa_state_datacheck
This commit is contained in:
parent
1091aa0830
commit
e6d1472824
@ -55,9 +55,25 @@ void wtp_dfa_state_datacheck(struct capwap_parsed_packet* packet)
|
|||||||
unsigned short binding;
|
unsigned short binding;
|
||||||
struct capwap_resultcode_element* resultcode;
|
struct capwap_resultcode_element* resultcode;
|
||||||
|
|
||||||
|
if (packet->rxmngpacket->ctrlmsg.type != CAPWAP_CHANGE_STATE_EVENT_RESPONSE) {
|
||||||
|
capwap_logging_debug("Unexpected message %d in state Data Check",
|
||||||
|
packet->rxmngpacket->ctrlmsg.type);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
binding = GET_WBID_HEADER(packet->rxmngpacket->header);
|
binding = GET_WBID_HEADER(packet->rxmngpacket->header);
|
||||||
if ((binding == g_wtp.binding) && (packet->rxmngpacket->ctrlmsg.type == CAPWAP_CHANGE_STATE_EVENT_RESPONSE) && (g_wtp.localseqnumber == packet->rxmngpacket->ctrlmsg.seq)) {
|
if (binding != g_wtp.binding) {
|
||||||
|
capwap_logging_debug("Change State Event for invalid binding");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (g_wtp.localseqnumber != packet->rxmngpacket->ctrlmsg.seq) {
|
||||||
|
capwap_logging_debug("Configuration Status Response with invalid sequence (%d != %d)",
|
||||||
|
g_wtp.localseqnumber, packet->rxmngpacket->ctrlmsg.seq);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
g_wtp.localseqnumber++;
|
g_wtp.localseqnumber++;
|
||||||
|
|
||||||
/* Valid packet, free request packet */
|
/* Valid packet, free request packet */
|
||||||
@ -68,8 +84,9 @@ void wtp_dfa_state_datacheck(struct capwap_parsed_packet* packet)
|
|||||||
if (resultcode && !CAPWAP_RESULTCODE_OK(resultcode->code)) {
|
if (resultcode && !CAPWAP_RESULTCODE_OK(resultcode->code)) {
|
||||||
capwap_logging_warning("Receive Data Check Response with error: %d", (int)resultcode->code);
|
capwap_logging_warning("Receive Data Check Response with error: %d", (int)resultcode->code);
|
||||||
wtp_teardown_connection();
|
wtp_teardown_connection();
|
||||||
} else {
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
wtp_start_datachannel();
|
wtp_start_datachannel();
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user