aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-09-23 13:28:24 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-09-23 16:30:49 +0200
commita39e2deff8f12f164f8a88fb061c66626bfe22a5 (patch)
treec4cfe81ef65a0d4148e8e933776847e97649f43b
parentb83b838bd1d0d4f3fe9d699e886634fe7d90f420 (diff)
gprs: Set bssgph field in bssgp_msgb_alloc()
Currently the bssgph field is not set when using the bssgp_tx_* functions. This hinders unit testing of generated messages. This patch initializes the bssgph field directly after allocation a new bssgp msgb in bssgp_msgb_alloc() so that it is set by default. Sponsored-by: On-Waves ehf
-rw-r--r--src/gb/gprs_bssgp_util.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gb/gprs_bssgp_util.c b/src/gb/gprs_bssgp_util.c
index 261e0b0f..604764c1 100644
--- a/src/gb/gprs_bssgp_util.c
+++ b/src/gb/gprs_bssgp_util.c
@@ -70,7 +70,9 @@ const char *bssgp_cause_str(enum gprs_bssgp_cause cause)
struct msgb *bssgp_msgb_alloc(void)
{
- return msgb_alloc_headroom(4096, 128, "BSSGP");
+ struct msgb *msg = msgb_alloc_headroom(4096, 128, "BSSGP");
+ msgb_bssgph(msg) = msg->data;
+ return msg;
}
/* Transmit a simple response such as BLOCK/UNBLOCK/RESET ACK/NACK */