summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-01-15 20:43:52 +0100
committerHarald Welte <laforge@gnumonks.org>2017-01-15 20:46:26 +0100
commitc9ad46ac75d6cbd4336f405d6dc2dc6a2975c25e (patch)
tree27aa4fae745fb25acca378184071cc745ca4fe34
parent214236fd5d89535985a18677de760c68fee9e11a (diff)
Fix encoding of padding at end of CLASSMARK 3 IE
Contrary to e.g. SI rest octets, the padding at the end of a CLASSMARK 3 Information Element is padded with zeros, not with L. There is no 0x2b padding in this case.
-rw-r--r--src/host/layer23/src/mobile/gsm48_rr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/host/layer23/src/mobile/gsm48_rr.c b/src/host/layer23/src/mobile/gsm48_rr.c
index 76eaf8f..9bef286 100644
--- a/src/host/layer23/src/mobile/gsm48_rr.c
+++ b/src/host/layer23/src/mobile/gsm48_rr.c
@@ -1203,9 +1203,9 @@ static int gsm48_rr_enc_cm3(struct osmocom_ms *ms, uint8_t *buf, uint8_t *len)
}
/* info: The max number of bits are about 80. */
- /* partitial bytes will be completed */
+ /* partial bytes will be padded with zero */
*len = (bv.cur_bit + 7) >> 3;
- bitvec_spare_padding(&bv, (*len * 8) - 1);
+ bitvec_fill(&bv, (*len*8) - bv.cur_bit, ZERO);
return 0;
}