aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-dcm.c
diff options
context:
space:
mode:
authorRich Coe <richcoe2@gmail.com>2016-01-17 23:30:51 -0600
committerAnders Broman <a.broman58@gmail.com>2016-01-19 05:58:44 +0000
commit5335f1d065b1e30619ed7c2ba4a68b9df48ad157 (patch)
tree25c1d9a8bb13edcc8053874f2799d421a1846595 /epan/dissectors/packet-dcm.c
parent174fa7e2f7662a080231fd31250d8bd1b23cd5b3 (diff)
DCM: ignore the upper flag bits of PDV in PDU DATA packet
The DICOM protocol in PS3.8 E.2 says bits 2-7 should be set to zero by the sender and not checked by the receiver. The version of software sending a bad PDV flags is PACSONE01AUG03. The version of this software might be 2004-02-07 (or earlier) found at http://www.pacsone.net/download.htm Change-Id: If4d9d8e63d7bdba0f8f1c50e49979ca15b5f9157 Reviewed-on: https://code.wireshark.org/review/13384 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-dcm.c')
-rw-r--r--epan/dissectors/packet-dcm.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/epan/dissectors/packet-dcm.c b/epan/dissectors/packet-dcm.c
index dbadbdcbcb..2329b9aca3 100644
--- a/epan/dissectors/packet-dcm.c
+++ b/epan/dissectors/packet-dcm.c
@@ -1,6 +1,6 @@
/* packet-dcm.c
* Routines for DICOM dissection
- * Copyright 2003, Rich Coe <Richard.Coe@med.ge.com>
+ * Copyright 2003, Rich Coe <richcoe2@gmail.com>
* Copyright 2008-2010, David Aggeler <david_aggeler@hispeed.ch>
*
* DICOM communication protocol
@@ -5548,7 +5548,7 @@ dissect_dcm_pdv_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
const gchar *desc_flag = NULL; /* Flag Description in tree */
gchar *desc_header = NULL; /* Used for PDV description */
- guint8 flags = 0;
+ guint8 flags = 0, o_flags = 0;
guint8 pctx_id = 0;
/* 1 Byte Context */
@@ -5592,7 +5592,9 @@ dissect_dcm_pdv_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
/* 1 Byte Flag */
- flags = tvb_get_guint8(tvb, offset);
+ /* PS3.8 E.2 Bits 2 through 7 are always set to 0 by the sender and never checked by the receiver. */
+ o_flags = tvb_get_guint8(tvb, offset);
+ flags = 0x3 & o_flags;
(*pdv)->pctx_id = pctx_id;
@@ -5600,7 +5602,10 @@ dissect_dcm_pdv_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
switch (flags) {
case 0: /* 00 */
- desc_flag = "Data, More Fragments";
+ if (0 != (0xfc & o_flags))
+ desc_flag = "Data, More Fragments (Warning: Invalid)";
+ else
+ desc_flag = "Data, More Fragments";
(*pdv)->is_flagvalid = TRUE;
(*pdv)->is_command = FALSE;
@@ -5609,7 +5614,10 @@ dissect_dcm_pdv_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
break;
case 2: /* 10 */
- desc_flag = "Data, Last Fragment";
+ if (0 != (0xfc & o_flags))
+ desc_flag = "Data, Last Fragment (Warning: Invalid)";
+ else
+ desc_flag = "Data, Last Fragment";
(*pdv)->is_flagvalid = TRUE;
(*pdv)->is_command = FALSE;
@@ -5618,7 +5626,10 @@ dissect_dcm_pdv_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
break;
case 1: /* 01 */
- desc_flag = "Command, More Fragments";
+ if (0 != (0xfc & o_flags))
+ desc_flag = "Command, More Fragments (Warning: Invalid)";
+ else
+ desc_flag = "Command, More Fragments";
g_snprintf(desc_header, MAX_BUF_LEN, "Command"); /* Will be overwritten with real command tag */
(*pdv)->is_flagvalid = TRUE;
@@ -5628,7 +5639,10 @@ dissect_dcm_pdv_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
break;
case 3: /* 11 */
- desc_flag = "Command, Last Fragment";
+ if (0 != (0xfc & o_flags))
+ desc_flag = "Command, Last Fragment (Warning: Invalid)";
+ else
+ desc_flag = "Command, Last Fragment";
g_snprintf(desc_header, MAX_BUF_LEN, "Command");
(*pdv)->is_flagvalid = TRUE;
@@ -5679,9 +5693,9 @@ dissect_dcm_pdv_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
(*pdv)->desc = desc_header;
pdv_flags_pitem = proto_tree_add_uint_format(tree, hf_dcm_pdv_flags, tvb, offset, 1,
- flags, "Flags: 0x%02x (%s)", flags, desc_flag);
+ flags, "Flags: 0x%02x (%s)", o_flags, desc_flag);
- if (flags>3) {
+ if (o_flags>3) {
expert_add_info(pinfo, pdv_flags_pitem, &ei_dcm_pdv_flags);
}
offset +=1;