From c9ad46ac75d6cbd4336f405d6dc2dc6a2975c25e Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 15 Jan 2017 20:43:52 +0100 Subject: 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. --- src/host/layer23/src/mobile/gsm48_rr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/host/layer23/src/mobile/gsm48_rr.c b/src/host/layer23/src/mobile/gsm48_rr.c index 76eaf8f5..9bef2868 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; } -- cgit v1.2.3