tbf: Set ms in call to tbf_alloc_dl_tbf

The call to tbf_alloc_dl_tbf misses the pointer to the GprsMs object
which is already known in that case (tbf_reuse). This leads to a full
reallocation of the PDCH slots, which is possibly incompatible with
the old set of slots. This can result in hanging TCP connections and
TCP connection failures.

This commit replaces the old NULL value by the actual GprsMs object.
Since the set_ms() is also done within the tbf_alloc_dl_tbf method,
that call is removed.

Sponsored-by: On-Waves ehf
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index 771b35b..f307288 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -850,7 +850,7 @@
 
 	tfi = bts->tfi_find_free(GPRS_RLCMAC_DL_TBF, &trx, this->trx->trx_no);
 	if (tfi >= 0)
-		new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), NULL, tfi, trx,
+		new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(), tfi, trx,
 			ms_class(), 0);
 
 	if (!new_tbf) {
@@ -858,8 +858,6 @@
 		return;
 	}
 
-	new_tbf->set_ms(ms());
-
 	/* reset rlc states */
 	m_tx_counter = 0;
 	m_wait_confirm = 0;
diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err
index 1f016ed..b0dff02 100644
--- a/tests/tbf/TbfTest.err
+++ b/tests/tbf/TbfTest.err
@@ -81,8 +81,6 @@
  Found TFI=1.
 ********** TBF starts here **********
 Allocating DL TBF: TFI=1 TRX=0 MS_CLASS=45
-Creating MS object, TLLI = 0x00000000
-Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45
 Slot Allocation (Algorithm A) for class 45
 - Skipping TS 0, because not enabled
 - Skipping TS 1, because not enabled
@@ -94,9 +92,6 @@
 - Assign downlink TS=4
 PDCH(TS 4, TRX 0): Attaching TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL), 2 TBFs.
 - Setting Control TS 4
-Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL)
-Detaching TBF from MS object, TLLI = 0x00000000, TBF = TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL)
-Destroying MS object, TLLI = 0x00000000
 Attaching TBF to MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=1 TLLI=0xffeeddcc DIR=DL STATE=NULL)
 Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE)
 ********** TBF update **********
@@ -173,8 +168,6 @@
  Found TFI=1.
 ********** TBF starts here **********
 Allocating DL TBF: TFI=1 TRX=0 MS_CLASS=45
-Creating MS object, TLLI = 0x00000000
-Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45
 Slot Allocation (Algorithm A) for class 45
 - Skipping TS 0, because not enabled
 - Skipping TS 1, because not enabled
@@ -186,9 +179,6 @@
 - Assign downlink TS=4
 PDCH(TS 4, TRX 0): Attaching TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL), 2 TBFs.
 - Setting Control TS 4
-Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL)
-Detaching TBF from MS object, TLLI = 0x00000000, TBF = TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL)
-Destroying MS object, TLLI = 0x00000000
 Attaching TBF to MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=1 TLLI=0xffeeddcc DIR=DL STATE=NULL)
 Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE)
 ********** TBF update **********