From f6e4d082194e41c8a5b51a46c578921006496309 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Sun, 6 Dec 2015 19:03:35 +0100 Subject: gtphub: fix: when checking TEIs, skip 0. Sponsored-by: On-Waves ehi --- openbsc/src/gprs/gtphub.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openbsc/src/gprs/gtphub.c b/openbsc/src/gprs/gtphub.c index 923c55373..24d0c5829 100644 --- a/openbsc/src/gprs/gtphub.c +++ b/openbsc/src/gprs/gtphub.c @@ -1217,6 +1217,8 @@ static int gtphub_check_mapped_tei(struct gtphub_tunnel_endpoint *new_te, uint32_t *tei_min, uint32_t *tei_max) { + if (!new_te->tei_repl) + return 1; if (new_te->tei_repl != iterated_te->tei_repl) return 1; @@ -1265,7 +1267,8 @@ static int gtphub_check_reused_teis(struct gtphub *hub, for_each_plane(plane_idx) { te = &tun->endpoint[side_idx][plane_idx]; te2 = &new_tun->endpoint[side_idx][plane_idx]; - if ((te->tei_orig != te2->tei_orig) + if ((te->tei_orig == 0) + || (te->tei_orig != te2->tei_orig) || (!te->peer) || (!te2->peer) || !gsn_addr_same(&te->peer->peer_addr->addr, -- cgit v1.2.3