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
diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c
index 4fa77ac..20d1180 100644
--- a/openbsc/src/gprs/gb_proxy.c
+++ b/openbsc/src/gprs/gb_proxy.c
@@ -433,12 +433,10 @@
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 @@
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 =