Wrong interpretation of the cbsp.rep_period field in epan/dissectors/packet-gsm_cbsp.c
Summary
Wrong interpretation of the cbsp.rep_period field in epan/dissectors/packet-gsm_cbsp.c
Steps to reproduce
Open capture that contains CBSP traffic. Observe field cbsp.rep_period.
What is the current bug behavior?
epan/dissectors/packet-gsm_cbsp.c interprets this field as a big-endian unsigned 16-bit integer.
This is not correct.
What is the expected correct behavior?
Section 8.2.8 of 3GPP TS 48.049 (https://www.3gpp.org/ftp/Specs/archive/48_series/48.049/48049-h00.zip) specifies the "Repetition Period" Information Element (IE) of the Cell Broadcast Service Protocol (CBSP) as follows:
| 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
+-----------------------------------------------+
| Element identifier | octet 1
+-----------------------+-----------------------+
| Repetition Period | octet 2
+-----------------------+-----------------------+
| Spare |Repetition Period cont.| octet 3
+-----------------------+-----------------------+
It is a 12-bit field that occupies two octets, where bits 5-8 of the octet 3 ("Spare") do not belong to the representation of that quantity. They are always set to 0.
As for the correct byte order, section 8.2.1 states that:
The following conventions are assumed for the sequence of transmission of bits and bytes:
- Each bit position is marked as 1 to 8. Bit 1 is the least significant bit and is transmitted first;
- In an element octets are identified by numbers, octet 1 is transmitted first, then octet 2, etc. When a field extends over more than one octet, the order of bit values progressively decreases as the octet number increases. The least significant bit >of the field is represented by the lowest numbered bit of the highest numbered octet of the field.
A Repetition Period information element given as octets 06 01 00 is currently displayed as decimal 256.
The correct display should be decimal 16.
Sample capture file
220802_Huawei_2G_TC1.11_v2_frame_946.pcap
Build information
The issue occurs in the "master" branch.