GPRS: Fix calculation of 'Extension Length' in GPRS Cell Options
The actual 'Extension Length' field in the 'GPRS Cell Options' IE
is coded the length - 1, not the full length. Without this fix,
the code has an off-by-one error.
diff --git a/openbsc/src/rest_octets.c b/openbsc/src/rest_octets.c
index fd56caf..039d2c8 100644
--- a/openbsc/src/rest_octets.c
+++ b/openbsc/src/rest_octets.c
@@ -327,12 +327,12 @@
bitvec_set_bit(bv, 1);
if (!gco->ext_info.egprs_supported) {
/* 6bit length of extension */
- bitvec_set_uint(bv, 1 + 3, 6);
+ bitvec_set_uint(bv, (1 + 3)-1, 6);
/* EGPRS supported in the cell */
bitvec_set_bit(bv, 0);
} else {
/* 6bit length of extension */
- bitvec_set_uint(bv, 1 + 5 + 3, 6);
+ bitvec_set_uint(bv, (1 + 5 + 3)-1, 6);
/* EGPRS supported in the cell */
bitvec_set_bit(bv, 1);
/* 1bit EGPRS PACKET CHANNEL REQUEST */