aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2021-01-05 15:52:05 +0100
committerDaniel Willmann <dwillmann@sysmocom.de>2021-01-05 18:29:39 +0100
commitddb3fbb0f2e88b5cc46809dcfac29eccea67d53f (patch)
treee023295b085ea30e6b05b87670ce39552fad2120 /src
parente245677cdd27e488ef6a92f36aca875e52d63816 (diff)
Fix gbproxy_sgsn_by_tlli wraparound
Diffstat (limited to 'src')
-rw-r--r--src/gbproxy/gb_proxy_peer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gbproxy/gb_proxy_peer.c b/src/gbproxy/gb_proxy_peer.c
index 544eb5f7..d2ddfc17 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;