From 3dab804250ad4c648438fb23a107d74b51f4480f Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 8 Apr 2018 00:51:31 +0200 Subject: 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 Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin --- epan/dissectors/packet-lapdm.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/epan/dissectors/packet-lapdm.c b/epan/dissectors/packet-lapdm.c index dc282a05ed..ce4225257f 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); } /* -- cgit v1.2.3