mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-10-23 08:12:01 +00:00
gbproxy: Only search by valid identifiers
Don't return a link_info if TLLI is 0 resp. P-TMSI is 0xffff. These values are used for uninitialised or cleared fields and can possibly match several entries. Sponsored-by: On-Waves ehf
This commit is contained in:
committed by
Holger Hans Peter Freyther
parent
d4c79a458b
commit
ba6267f05a
@@ -38,6 +38,9 @@ struct gbproxy_link_info *gbproxy_link_info_by_tlli(struct gbproxy_peer *peer,
|
||||
struct gbproxy_link_info *link_info;
|
||||
struct gbproxy_patch_state *state = &peer->patch_state;
|
||||
|
||||
if (!tlli)
|
||||
return NULL;
|
||||
|
||||
llist_for_each_entry(link_info, &state->logical_links, list)
|
||||
if (link_info->tlli.current == tlli ||
|
||||
link_info->tlli.assigned == tlli)
|
||||
@@ -53,6 +56,9 @@ struct gbproxy_link_info *gbproxy_link_info_by_ptmsi(
|
||||
struct gbproxy_link_info *link_info;
|
||||
struct gbproxy_patch_state *state = &peer->patch_state;
|
||||
|
||||
if (ptmsi == GSM_RESERVED_TMSI)
|
||||
return NULL;
|
||||
|
||||
llist_for_each_entry(link_info, &state->logical_links, list)
|
||||
if (link_info->tlli.ptmsi == ptmsi)
|
||||
return link_info;
|
||||
@@ -67,6 +73,9 @@ struct gbproxy_link_info *gbproxy_link_info_by_any_sgsn_tlli(
|
||||
struct gbproxy_link_info *link_info;
|
||||
struct gbproxy_patch_state *state = &peer->patch_state;
|
||||
|
||||
if (!tlli)
|
||||
return NULL;
|
||||
|
||||
/* Don't care about the NSEI */
|
||||
llist_for_each_entry(link_info, &state->logical_links, list)
|
||||
if (link_info->sgsn_tlli.current == tlli ||
|
||||
@@ -83,6 +92,9 @@ struct gbproxy_link_info *gbproxy_link_info_by_sgsn_tlli(
|
||||
struct gbproxy_link_info *link_info;
|
||||
struct gbproxy_patch_state *state = &peer->patch_state;
|
||||
|
||||
if (!tlli)
|
||||
return NULL;
|
||||
|
||||
llist_for_each_entry(link_info, &state->logical_links, list)
|
||||
if ((link_info->sgsn_tlli.current == tlli ||
|
||||
link_info->sgsn_tlli.assigned == tlli) &&
|
||||
|
Reference in New Issue
Block a user