For safety, check TEID presence in GTP

This commit is contained in:
Sukchan Lee 2020-01-01 20:17:46 +09:00
parent d1f3439f93
commit 0891ee5b19
3 changed files with 4 additions and 4 deletions

View File

@ -509,7 +509,7 @@ void mme_state_operational(ogs_fsm_t *s, mme_event_t *e)
* However in this case, the cause code shall not be set to
* "Context not found".
*/
if (gtp_message.h.teid != 0) {
if (gtp_message.h.teid_presence && gtp_message.h.teid != 0) {
/* Cause is not "Context not found" */
mme_ue = mme_ue_find_by_teid(gtp_message.h.teid);
}

View File

@ -111,7 +111,7 @@ void pgw_state_operational(ogs_fsm_t *s, pgw_event_t *e)
* However in this case, the cause code shall not be set to
* "Context not found".
*/
if (message->h.teid != 0) {
if (message->h.teid_presence && message->h.teid != 0) {
/* Cause is not "Context not found" */
sess = pgw_sess_find_by_teid(message->h.teid);
}

View File

@ -73,7 +73,7 @@ void sgw_state_operational(ogs_fsm_t *s, sgw_event_t *e)
rv = ogs_gtp_parse_msg(&message, pkbuf);
ogs_assert(rv == OGS_OK);
if (message.h.teid != 0) {
if (message.h.teid_presence && message.h.teid != 0) {
/* Cause is not "Context not found" */
sgw_ue = sgw_ue_find_by_teid(message.h.teid);
}
@ -158,7 +158,7 @@ void sgw_state_operational(ogs_fsm_t *s, sgw_event_t *e)
rv = ogs_gtp_parse_msg(&message, pkbuf);
ogs_assert(rv == OGS_OK);
if (message.h.teid != 0) {
if (message.h.teid_presence && message.h.teid != 0) {
sess = sgw_sess_find_by_teid(message.h.teid);
}