Ignore session in teardown state

This commit is contained in:
vemax78 2013-10-21 18:54:40 +02:00
parent 3147abc9bc
commit f82cca5e81

View File

@ -70,8 +70,12 @@ static struct ac_session_t* ac_search_session_from_wtpaddress(struct sockaddr_st
ASSERT(session != NULL);
if (!capwap_compare_ip(address, (isctrlsocket ? &session->wtpctrladdress : &session->wtpdataaddress))) {
/* Return session if not teardown */
if (!session->teardown) {
session->count++;
result = session;
}
break;
}
@ -202,8 +206,11 @@ static struct ac_session_t* ac_get_session_from_keepalive(void* buffer, int buff
ASSERT(session != NULL);
if (!memcmp(sessionid, &session->sessionid, sizeof(struct capwap_sessionid_element))) {
if (!session->teardown) {
session->count++;
result = session;
}
break;
}
@ -227,7 +234,9 @@ static struct ac_session_t* ac_get_session_from_keepalive(void* buffer, int buff
/* Close session */
static void ac_close_session(struct ac_session_t* session) {
if (!session->teardown) {
ac_session_send_action(session, AC_SESSION_ACTION_CLOSE, 0, NULL, 0);
}
}
/* Close sessions */