bts: Release DL TBF instead of killing in rcv_resource_request

Currently an existing DL TBF is freed immediately, when a resource
request is received. This makes sense since the MS might have dropped
it when switching to the PDCH signaled via the AGCH for the SBA. But
if the TBF still is assumed to exist on the MS side, there might be
TFI collisions if the old TBF object is not kept to block its TFI
for some time.

This commit changes rcv_resource_request to call release() instead of
tbf_free() on the DL TBF object (if it exists).

Sponsored-by: On-Waves ehf
diff --git a/src/bts.cpp b/src/bts.cpp
index 98a23cc..6528915 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -984,17 +984,23 @@
 				"TLLI=0x%08x while %s still "
 				"exists. Killing pending UL TBF\n",
 				tlli, tbf_name(ul_tbf));
+			/* The MS will not use the old TBF again, so we can
+			 * safely throw it away immediately */
 			tbf_free(ul_tbf);
 			ul_tbf = NULL;
 		}
 
 		if (dl_tbf) {
+			/* TODO: There a chance that releasing dl_tbf can be
+			 * avoided if this PDCH is the control TS of dl_tbf,
+			 * but this needs to be checked with the spec. If an MS
+			 * losed the DL TBF because of PDCH mismatches only,
+			 * this check would make sense. */
 			LOGP(DRLCMACUL, LOGL_NOTICE, "Got RACH from "
 				"TLLI=0x%08x while %s still exists. "
-				"Killing pending DL TBF\n", tlli,
+				"Release pending DL TBF\n", tlli,
 				tbf_name(dl_tbf));
-			tbf_free(dl_tbf);
-			dl_tbf = NULL;
+			dl_tbf->release();
 		}
 		LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF "
 			"in packet resource request of single "