aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-btrfcomm.c
diff options
context:
space:
mode:
authorMichal Labedzki <michal.labedzki@tieto.com>2014-08-12 15:47:04 +0200
committerMichal Labedzki <michal.labedzki@tieto.com>2014-08-21 10:22:06 +0000
commit98f16d5b70904230cddb8ee6d57236f586b11460 (patch)
tree81579a1cb991ea6fb9cdeee3f5419027fb1ed570 /epan/dissectors/packet-btrfcomm.c
parent87550a6ab49a4083587d91498a12dc92bf5650ac (diff)
Bluetooth: RFCOMM: Fix recognizing services
Add support for missing direction flag in dlci. Change-Id: I1429eb65374014e7b840bb31ca1d6f2ab1959160 Reviewed-on: https://code.wireshark.org/review/3766 Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Diffstat (limited to 'epan/dissectors/packet-btrfcomm.c')
-rw-r--r--epan/dissectors/packet-btrfcomm.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/epan/dissectors/packet-btrfcomm.c b/epan/dissectors/packet-btrfcomm.c
index f32f3c2c2e..b9e5d9de74 100644
--- a/epan/dissectors/packet-btrfcomm.c
+++ b/epan/dissectors/packet-btrfcomm.c
@@ -666,6 +666,7 @@ dissect_btrfcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
guint32 k_frame_number;
guint32 k_chandle;
guint32 k_channel;
+ guint32 k_dlci;
service_direction_t *service_direction;
wmem_tree_t *subtree;
@@ -675,6 +676,7 @@ dissect_btrfcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
k_psm = l2cap_data->psm;
k_channel = dlci >> 1;
k_frame_number = pinfo->fd->num;
+ k_dlci = dlci;
key[0].length = 1;
key[0].key = &k_interface_id;
@@ -685,7 +687,7 @@ dissect_btrfcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
key[3].length = 1;
key[3].key = &k_psm;
key[4].length = 1;
- key[4].key = &k_channel;
+ key[4].key = &k_dlci;
if (!pinfo->fd->flags.visited && frame_type == FRAME_TYPE_SABM) {
key[5].length = 0;
@@ -708,7 +710,7 @@ dissect_btrfcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
wmem_tree_insert32_array(service_directions, key, service_direction);
}
-
+ key[4].key = &k_channel;
key[5].length = 0;
key[5].key = NULL;
@@ -717,7 +719,10 @@ dissect_btrfcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
if (service_direction && service_direction->end_in > k_frame_number) {
k_direction = service_direction->direction;
} else {
- k_direction = (l2cap_data->is_local_psm) ? P2P_DIR_SENT : P2P_DIR_RECV;
+ if (dlci & 0x01)
+ k_direction = (l2cap_data->is_local_psm) ? P2P_DIR_RECV : P2P_DIR_SENT;
+ else
+ k_direction = (l2cap_data->is_local_psm) ? P2P_DIR_SENT : P2P_DIR_RECV;
}
k_psm = SDP_PSM_DEFAULT;