aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-04-08 00:51:31 +0200
committerPascal Quantin <pascal.quantin@gmail.com>2018-04-17 14:26:11 +0000
commit3dab804250ad4c648438fb23a107d74b51f4480f (patch)
tree1249d011fd756c8fd8a51e235ca9612f8713f3e3
parent91e0de19c921b91401421b06bd2b90cdbe1c7166 (diff)
lapdm: Hand B4 frames into a dissector supporting L2 pseudo-length
B4 frames have no length octet at L2 level, but instead a L2 pseudo length octet at L3. We must call the proper dissector for decoding them, and gsm_a_ccch supports L2 pseudo length. This addresses the LAPDm side of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=14105 Ping-Bug: 14105 Change-Id: I5743dc6153a1adae60b8d9564f345861edc3fca4 Reviewed-on: https://code.wireshark.org/review/26798 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
-rw-r--r--epan/dissectors/packet-lapdm.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/epan/dissectors/packet-lapdm.c b/epan/dissectors/packet-lapdm.c
index dc282a0..ce42252 100644
--- a/epan/dissectors/packet-lapdm.c
+++ b/epan/dissectors/packet-lapdm.c
@@ -48,6 +48,8 @@
void proto_register_lapdm(void);
+static dissector_handle_t b4_info_handle;
+
static int proto_lapdm = -1;
static int hf_lapdm_address = -1;
static int hf_lapdm_ea = -1;
@@ -365,6 +367,12 @@ dissect_lapdm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
*/
pinfo->fragmented = save_fragmented;
}
+ else if (hdr_type == LAPDM_HDR_FMT_B4)
+ {
+ /* B4 frames have no length octet at L2 level, but instead a L2 pseudo length octet
+ * at L3. We must call the proper dissector for decoding them */
+ call_dissector(b4_info_handle, payload, pinfo, tree);
+ }
else
{
if (!PINFO_FD_VISITED(pinfo) && ((control & XDLC_S_U_MASK) == XDLC_U) && ((control & XDLC_U_MODIFIER_MASK) == XDLC_SABM)) {
@@ -540,6 +548,11 @@ proto_register_lapdm(void)
reassembly_table_register(&lapdm_reassembly_table,
&addresses_reassembly_table_functions);
+
+ /* B4 frames have no length octet at L2 level, but instead a L2 pseudo length octet
+ * at L3. We must call the proper dissector for decoding them, and gsm_a_ccch supports
+ * L2 pseudo length */
+ b4_info_handle = find_dissector_add_dependency("gsm_a_ccch", proto_lapdm);
}
/*