diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-08-04 12:18:07 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-08-04 12:18:07 +0200 |
commit | 4d9fc422d2dd17118d70a2ed25ab383614a81ede (patch) | |
tree | 537698e1071939b13af37231e78b0bbc054fdd34 /openbsc/src | |
parent | 7127b0295eed1edea29ea88b352c2cfbff59c610 (diff) |
gbproxy: Use gbprox_delete_tlli if possible
Make use of the delete routine in more places and get test coverage
for it.
Done with Jacob
Diffstat (limited to 'openbsc/src')
-rw-r--r-- | openbsc/src/gprs/gb_proxy.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c index 4fa77acac..20d1180c4 100644 --- a/openbsc/src/gprs/gb_proxy.c +++ b/openbsc/src/gprs/gb_proxy.c @@ -433,12 +433,10 @@ static void gbprox_delete_tllis(struct gbproxy_peer *peer) struct gbproxy_tlli_info *tlli_info, *nxt; struct gbproxy_patch_state *state = &peer->patch_state; - llist_for_each_entry_safe(tlli_info, nxt, &state->enabled_tllis, list) { - llist_del(&tlli_info->list); - talloc_free(tlli_info); - } - state->enabled_tllis_count = 0; + llist_for_each_entry_safe(tlli_info, nxt, &state->enabled_tllis, list) + gbprox_delete_tlli(peer, tlli_info); + OSMO_ASSERT(state->enabled_tllis_count == 0); OSMO_ASSERT(llist_empty(&state->enabled_tllis)); } @@ -634,9 +632,7 @@ static void gbprox_unregister_tlli(struct gbproxy_peer *peer, uint32_t tlli) LOGP(DGPRS, LOGL_INFO, "Removing TLLI %08x from list\n", tlli); - llist_del(&tlli_info->list); - talloc_free(tlli_info); - state->enabled_tllis_count -= 1; + gbprox_delete_tlli(peer, tlli_info); } peer->ctrg->ctr[GBPROX_PEER_CTR_TLLI_CACHE_SIZE].current = |