aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-09-25 09:12:15 +0200
committerHarald Welte <laforge@gnumonks.org>2018-09-25 09:12:15 +0200
commit2406919dbfbd83b5a1033d6e68d5528423aa694e (patch)
tree129fe1c92b82780961197a0853993f300b7383f1
parente28a4f4f7ebf094a46a7beb5f5f974333e789943 (diff)
CBSP: Message Content is a fixed-length IElaforge/cbsp
There is a "User Info Length" field, but that field doesn't determine the actual length of the IE, but only the number of non-padding bytes within that IE. Let's solve this by making the IE a fixed-length IE of 83 bytes (83 + tag). Change-Id: Ib23254fb5eded555c1e79ff7a8f19703f5cc8cf8
-rw-r--r--epan/dissectors/packet-gsm_cbsp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/epan/dissectors/packet-gsm_cbsp.c b/epan/dissectors/packet-gsm_cbsp.c
index cab2004..606ead2 100644
--- a/epan/dissectors/packet-gsm_cbsp.c
+++ b/epan/dissectors/packet-gsm_cbsp.c
@@ -289,7 +289,7 @@ static const value_string cbsp_cause_vals[] = {
static const struct tlv_definition cbsp_att_tlvdef = {
.def = {
- [CBSP_IEI_MSG_CONTENT] = { TLV_TYPE_TLV, 0 },
+ [CBSP_IEI_MSG_CONTENT] = { TLV_TYPE_FIXED, 83 },
[CBSP_IEI_OLD_SERIAL_NR] = { TLV_TYPE_FIXED, 2 },
[CBSP_IEI_NEW_SERIAL_NR] = { TLV_TYPE_FIXED, 2 },
[CBSP_IEI_CELL_LIST] = { TLV_TYPE_TL16V, 0 },
@@ -349,6 +349,7 @@ static int hf_cbsp_num_of_res_slots = -1;
static int hf_cbsp_bcast_msg_type = -1;
static int hf_cbsp_warning_period = -1;
static int hf_cbsp_keepalive_period = -1;
+static int hf_cbsp_user_info_length = -1;
static gint ett_cbsp = -1;
static gint ett_cbsp_ie = -1;
@@ -358,7 +359,8 @@ static dissector_handle_t gsm_cbs_handle;
static void
dissect_cbsp_content_ie(tvbuff_t *tvb, packet_info *pinfo, guint offset, gint len, proto_tree *tree)
{
- tvbuff_t *next_tvb = tvb_new_subset_length(tvb, offset, len);
+ tvbuff_t *next_tvb = tvb_new_subset_length(tvb, offset+1, len-1);
+ proto_tree_add_item(tree, hf_cbsp_user_info_length, tvb, offset, 1, ENC_NA);
call_dissector(gsm_cbs_handle, next_tvb, pinfo, tree);
}
@@ -576,6 +578,8 @@ proto_register_cbsp(void)
FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } },
{ &hf_cbsp_keepalive_period, { "Keepalive Repetition Period", "cbsp.keepalive_rep_period",
FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } },
+ { &hf_cbsp_user_info_length, { "User Information Length", "cbsp.user_info_len",
+ FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } },
};
static gint *ett[] = {
&ett_cbsp,