aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-btavdtp.c
diff options
context:
space:
mode:
authorMichal Labedzki <michal.labedzki@tieto.com>2014-04-11 09:22:46 +0200
committerMichal Labedzki <michal.labedzki@tieto.com>2014-05-30 11:25:50 +0000
commit5742d2e145cb6c9eed517685d5229ac17bc775b1 (patch)
tree3dce8008201d0afe78601317928f67e9dc8bdc56 /epan/dissectors/packet-btavdtp.c
parente3473c921fe1780b23cb0f046d0c2a7558743518 (diff)
Bluetooth: L2CAP: Another fix for CIDs
Example: if there is Connection Request than field with CID always is called SCID. If we Sent this packet, it is okay, but if we Receive it, then it is not SCID for us, but DCID. If we receive Connection Request (DCID) and than we want to make disconnection, so we send Disconnection Request with DCID that is SCID in Connection Request... etc. I try to clarify this, so rename stored SCID to Local CID and DCID to Remote CID. Change-Id: Idde0939a03955d8f4a10d8c9f7c43fd364254460 Reviewed-on: https://code.wireshark.org/review/1879 Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Diffstat (limited to 'epan/dissectors/packet-btavdtp.c')
-rw-r--r--epan/dissectors/packet-btavdtp.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/epan/dissectors/packet-btavdtp.c b/epan/dissectors/packet-btavdtp.c
index ce68ae3165..4ec022f3c0 100644
--- a/epan/dissectors/packet-btavdtp.c
+++ b/epan/dissectors/packet-btavdtp.c
@@ -502,11 +502,10 @@ typedef struct _media_stream_number_value_t {
} media_stream_number_value_t;
typedef struct _channels_info_t {
- gint32 control_scid;
- gint32 control_dcid;
- gint32 media_scid;
- gint32 media_dcid;
- gboolean media_is_local_psm;
+ gint32 control_local_cid;
+ gint32 control_remote_cid;
+ gint32 media_local_cid;
+ gint32 media_remote_cid;
wmem_tree_t *stream_numbers;
guint32 disconnect_in_frame;
guint32 *l2cap_disconnect_in_frame;
@@ -1140,10 +1139,10 @@ dissect_btavdtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
if (!(channels_info && *channels_info->l2cap_disconnect_in_frame >= pinfo->fd->num && channels_info->disconnect_in_frame >= pinfo->fd->num)) {
channels_info = (channels_info_t *) wmem_new (wmem_file_scope(), channels_info_t);
- channels_info->control_scid = l2cap_data->scid;
- channels_info->control_dcid = l2cap_data->dcid;
- channels_info->media_scid = -1;
- channels_info->media_dcid = -1;
+ channels_info->control_local_cid = l2cap_data->local_cid;
+ channels_info->control_remote_cid = l2cap_data->remote_cid;
+ channels_info->media_local_cid = -1;
+ channels_info->media_remote_cid = -1;
channels_info->disconnect_in_frame = G_MAXUINT32;
channels_info->l2cap_disconnect_in_frame = l2cap_data->disconnect_in_frame;
channels_info->sep = NULL;
@@ -1161,16 +1160,15 @@ dissect_btavdtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
}
}
- if (!(l2cap_data->scid == channels_info->control_scid &&
- l2cap_data->dcid == channels_info->control_dcid) &&
- (channels_info->media_scid == -1 ||
- (l2cap_data->scid == channels_info->media_scid &&
- l2cap_data->dcid == channels_info->media_dcid))) {
+ if (!(l2cap_data->local_cid == channels_info->control_local_cid &&
+ l2cap_data->remote_cid == channels_info->control_remote_cid) &&
+ (channels_info->media_local_cid == -1 ||
+ (l2cap_data->local_cid == channels_info->media_local_cid &&
+ l2cap_data->remote_cid == channels_info->media_remote_cid))) {
- if (!pinfo->fd->flags.visited && channels_info->media_scid == -1) {
- channels_info->media_scid = l2cap_data->scid;
- channels_info->media_dcid = l2cap_data->dcid;
- channels_info->media_is_local_psm = l2cap_data->is_local_psm;
+ if (!pinfo->fd->flags.visited && channels_info->media_local_cid == -1) {
+ channels_info->media_local_cid = l2cap_data->local_cid;
+ channels_info->media_remote_cid = l2cap_data->remote_cid;
}
/* Media Channel */
@@ -1286,8 +1284,8 @@ dissect_btavdtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
}
return tvb_length(tvb);
- } else if (!(l2cap_data->scid == channels_info->control_scid &&
- l2cap_data->dcid == channels_info->control_dcid)) {
+ } else if (!(l2cap_data->local_cid == channels_info->control_local_cid &&
+ l2cap_data->remote_cid == channels_info->control_remote_cid)) {
/* Unknown Stream Channel */
ti = proto_tree_add_item(tree, proto_btavdtp, tvb, offset, -1, ENC_NA);
btavdtp_tree = proto_item_add_subtree(ti, ett_btavdtp);