diff options
author | Harald Welte <laforge@gnumonks.org> | 2010-04-18 22:47:22 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2010-04-18 22:48:46 +0200 |
commit | 39608dc04557ac050de6a05a6d41239fc18d9eb8 (patch) | |
tree | 48ae4e0bd43b44e3fa17dabf1d300aabfc1d4930 /openbsc/src/rest_octets.c | |
parent | 5fda90816f0623b32ddb60f1cf4d9d67119de811 (diff) |
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.
Diffstat (limited to 'openbsc/src/rest_octets.c')
-rw-r--r-- | openbsc/src/rest_octets.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/openbsc/src/rest_octets.c b/openbsc/src/rest_octets.c index fd56caf81..039d2c83a 100644 --- a/openbsc/src/rest_octets.c +++ b/openbsc/src/rest_octets.c @@ -327,12 +327,12 @@ static int append_gprs_cell_opt(struct bitvec *bv, 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 */ |