diff options
author | Max <msuraev@sysmocom.de> | 2017-12-11 12:09:34 +0100 |
---|---|---|
committer | Max <msuraev@sysmocom.de> | 2017-12-11 12:27:49 +0100 |
commit | 4bd710d107786ecf838f568171a0175d157e809d (patch) | |
tree | b40d93001d142552007d6646bcca37b6db2c627b /src | |
parent | eb79614f4e108f5d512bdee19aabb4af29a3f99b (diff) |
Generate SI2ter Rest Octets
Previously we simply omitted SI2ter Rest Octets which is spec violation
which lead to 'Malformed Packet' error in Wireshark RSL dissector. Fix
this by generating empty 'no rest octets' with proper padding. Adjust
test output accordingly.
Change-Id: Ie4419aaaf93a462f501f8d8f7bf2677d37c58f94
Fixes: OS#2711
Diffstat (limited to 'src')
-rw-r--r-- | src/libbsc/rest_octets.c | 16 | ||||
-rw-r--r-- | src/libbsc/system_information.c | 5 |
2 files changed, 20 insertions, 1 deletions
diff --git a/src/libbsc/rest_octets.c b/src/libbsc/rest_octets.c index 7c6d7cd92..b8a29bac5 100644 --- a/src/libbsc/rest_octets.c +++ b/src/libbsc/rest_octets.c @@ -461,6 +461,22 @@ static void append_gprs_ind(struct bitvec *bv, bitvec_set_bit(bv, L); } +/* Generate SI2ter Rest Octests 3GPP TS 44.018 Table 10.5.2.33a.1 */ +int rest_octets_si2ter(uint8_t *data) +{ + struct bitvec bv; + + memset(&bv, 0, sizeof(bv)); + bv.data = data; + bv.data_len = 4; + + /* No SI2ter_MP_CHANGE_MARK */ + bitvec_set_bit(&bv, L); + + bitvec_spare_padding(&bv, (bv.data_len * 8) - 1); + + return bv.data_len; +} /* Generate SI3 Rest Octests (Chapter 10.5.2.34 / Table 10.4.72) */ int rest_octets_si3(uint8_t *data, const struct gsm48_si_ro_info *si3) diff --git a/src/libbsc/system_information.c b/src/libbsc/system_information.c index c1b0d49f6..4575454d4 100644 --- a/src/libbsc/system_information.c +++ b/src/libbsc/system_information.c @@ -764,7 +764,10 @@ static int generate_si2ter(enum osmo_sysinfo_type t, struct gsm_bts *bts) if (!n) bts->si_valid &= ~(1 << SYSINFO_TYPE_2ter); - return sizeof(*si2t); + /* SI2ter Rest Octets as per 3GPP TS 44.018 ยง10.5.2.33a */ + rc = rest_octets_si2ter(si2t->rest_octets); + + return sizeof(*si2t) + rc; } /* SI2quater messages are optional - we only generate them when neighbor UARFCNs or EARFCNs are configured */ |