From ddb3fbb0f2e88b5cc46809dcfac29eccea67d53f Mon Sep 17 00:00:00 2001 From: Daniel Willmann Date: Tue, 5 Jan 2021 15:52:05 +0100 Subject: Fix gbproxy_sgsn_by_tlli wraparound Change-Id: I74ecb655f4d433f7ac14d00d934d237325aab606 Related: SYS#4865, OS#4472 --- src/gbproxy/gb_proxy_peer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gbproxy/gb_proxy_peer.c b/src/gbproxy/gb_proxy_peer.c index 544eb5f7a..d2ddfc17e 100644 --- a/src/gbproxy/gb_proxy_peer.c +++ b/src/gbproxy/gb_proxy_peer.c @@ -534,8 +534,9 @@ struct gbproxy_sgsn *gbproxy_sgsn_by_tlli(struct gbproxy_config *cfg, struct gbp i++; } // Start again from the beginning + i = 0; llist_for_each_entry(sgsn, &cfg->sgsns, list) { - if (i > index) { + if (i >= index) { break; } else if (sgsn->pool.allow_attach) { return sgsn; -- cgit v1.2.3