aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gtphub.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2015-11-27 01:20:53 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2015-12-03 11:40:22 +0100
commitd121ea612460b8a6f78a3bc91ab164651240f48a (patch)
treebc6e97a5f07ed02569f79d7de4b1df79f4428842 /openbsc/src/gprs/gtphub.c
parentf977320736fe15ffc3a0e6110bec7823a57c65ee (diff)
gtphub: use a single TEI pool across planes.
There's no need to keep two separate number pools when both can be fed from the same pool. User and Ctrl plane TEIs can technically overlap without colliding, but it doesn't hurt if they don't overlap, either. Sponsored-by: On-Waves ehi
Diffstat (limited to 'openbsc/src/gprs/gtphub.c')
-rw-r--r--openbsc/src/gprs/gtphub.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/openbsc/src/gprs/gtphub.c b/openbsc/src/gprs/gtphub.c
index 4f81c017f..5807f5f58 100644
--- a/openbsc/src/gprs/gtphub.c
+++ b/openbsc/src/gprs/gtphub.c
@@ -1449,7 +1449,7 @@ static int gtphub_handle_pdp_ctx_ies(struct gtphub *hub,
if (tei_from_ie) {
/* Create TEI mapping and replace in GTP packet IE */
- uint32_t mapped_tei = nr_pool_next(&hub->tei_pool[plane_idx]);
+ uint32_t mapped_tei = nr_pool_next(&hub->tei_pool);
tun->endpoint[side_idx][plane_idx].tei_orig = tei_from_ie;
tun->endpoint[side_idx][plane_idx].tei_repl = mapped_tei;
@@ -2105,10 +2105,10 @@ void gtphub_init(struct gtphub *hub)
expiry_init(&hub->expire_quickly, GTPH_EXPIRE_QUICKLY_SECS);
expiry_init(&hub->expire_slowly, GTPH_EXPIRE_SLOWLY_MINUTES * 60);
+ nr_pool_init(&hub->tei_pool, 1, 0xffffffff);
+
int plane_idx;
for_each_plane(plane_idx) {
- nr_pool_init(&hub->tei_pool[plane_idx], 1, 0xffffffff);
-
gtphub_bind_init(&hub->to_ggsns[plane_idx]);
gtphub_bind_init(&hub->to_sgsns[plane_idx]);
}