gtphub: fix: when checking TEIs, skip 0.

Sponsored-by: On-Waves ehi
This commit is contained in:
Neels Hofmeyr
2015-12-06 19:03:35 +01:00
parent 328d2f78c1
commit f6e4d08219

View File

@@ -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,