aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ipdc.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2004-10-22 18:03:21 +0000
committerGuy Harris <guy@alum.mit.edu>2004-10-22 18:03:21 +0000
commit7e0170ffbf61a98788f57366a1fb6680832ab8d0 (patch)
treeffa0221bc7db3db2ad0319a00107e1606a120104 /epan/dissectors/packet-ipdc.c
parent3530d9dc2461c17075816e00a3308a8fcc28484c (diff)
From Josh Bailey: fix the fetch of the IPDC payload length, it's only 10
bits long. svn path=/trunk/; revision=12378
Diffstat (limited to 'epan/dissectors/packet-ipdc.c')
-rw-r--r--epan/dissectors/packet-ipdc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/epan/dissectors/packet-ipdc.c b/epan/dissectors/packet-ipdc.c
index 3fafa560cc..3117e3f1eb 100644
--- a/epan/dissectors/packet-ipdc.c
+++ b/epan/dissectors/packet-ipdc.c
@@ -72,7 +72,10 @@ void proto_reg_handoff_ipdc(void);
static guint
get_ipdc_pdu_len(tvbuff_t *tvb, int offset)
{
- return tvb_get_ntohs(tvb,offset+2)+4;
+ /* lower 10 bits only */
+ guint raw_len = (tvb_get_ntohs(tvb,offset+2) & 0x03FF);
+
+ return raw_len + 4;
}
static void
@@ -98,7 +101,7 @@ dissect_ipdc_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gshort nr = tvb_get_guint8(tvb,0);
gshort ns = tvb_get_guint8(tvb,1);
- guint16 payload_len = (guint16) get_ipdc_pdu_len(tvb,0);
+ guint payload_len = get_ipdc_pdu_len(tvb,0);
gshort protocol_id;
gshort trans_id_size;
@@ -140,7 +143,7 @@ dissect_ipdc_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* IPDC tags present - display message code and trans. ID */
protocol_id = tvb_get_guint8(tvb,4);
- trans_id_size = TRANS_ID_SIZE_IPDC;
+ trans_id_size = TRANS_ID_SIZE_IPDC; /* tvb_get_guint8(tvb,5); */
trans_id = tvb_get_ntohl(tvb,6);
message_code = tvb_get_ntohs(tvb,6+trans_id_size);
offset = 6 + trans_id_size + 2; /* past message_code */