gtphub: fix restart cleanup peer matching.

Adjust test expectations accordingly.

Sponsored-by: On-Waves ehi
This commit is contained in:
Neels Hofmeyr 2015-12-02 15:44:34 +01:00
parent 996ec1d731
commit c6d51f5fb4
3 changed files with 11 additions and 4 deletions

View File

@ -1791,7 +1791,11 @@ static void gtphub_restarted(struct gtphub *hub,
llist_for_each_entry(tun, &hub->tunnels, entry) {
int side_idx;
for_each_side(side_idx) {
if (pp != tun->endpoint[side_idx][GTPH_PLANE_CTRL].peer)
struct gtphub_tunnel_endpoint *te = &tun->endpoint[side_idx][GTPH_PLANE_CTRL];
struct gtphub_tunnel_endpoint *te2 = &tun->endpoint[other_side_idx(side_idx)][GTPH_PLANE_CTRL];
if ((!te->peer)
|| (!te2->tei_orig)
|| (pp->peer_addr->peer != te->peer->peer_addr->peer))
continue;
LOG(LOGL_DEBUG, "Deleting tunnel due to peer restart: %s\n",

View File

@ -1320,7 +1320,7 @@ static void test_peer_restarted(void)
);
const char *gtp_req_to_ggsn =
MSG_PDP_CTX_REQ("0068",
"6d32", /* mapped seq ("1234") */
"6d33", /* mapped seq ("1234") */
"23",
"42000121436587f9",
"00000006", /* mapped TEI Data I ("123") */
@ -1340,7 +1340,7 @@ static void test_peer_restarted(void)
"192.168.42.23 (TEI C cba=5 / U abc=6)"
" <-> 192.168.43.34 / (uninitialized) (TEI C 0=0 / U 0=0)"
" @21955\n"
"192.168.42.23 (TEI C 321=1 / U 123=2)"
"(uninitialized) (TEI C 321=1 / U 123=2)"
" <-> 192.168.43.34 (TEI C 765=3 / U 567=4)"
" @21945\n"
));
@ -1348,7 +1348,7 @@ static void test_peer_restarted(void)
const char *gtp_resp_from_ggsn =
MSG_PDP_CTX_RSP("004e",
"00000005", /* destination TEI (sent in req above) */
"6d32", /* mapped seq */
"6d33", /* mapped seq */
"01", /* restart */
"00000def", /* TEI U */
"00000fde", /* TEI C */

View File

@ -19,6 +19,9 @@ test_peer_restarted
returning GGSN addr from imsi 240010123456789 ni internet: 192.168.43.34 port 2123
- __wrap_gtphub_resolve_ggsn_addr():
returning GGSN addr from imsi 240010123456789 ni internet: 192.168.43.34 port 2123
Out-of-band gtphub_write(16):
to 192.168.43.34 port 2123
32 14 00 08 00 00 07 65 6d 32 00 00 13 ff 14 00
test_peer_restarted_reusing_tei
- __wrap_gtphub_resolve_ggsn_addr():
returning GGSN addr from imsi 240010123456789 ni internet: 192.168.43.34 port 2123