diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-10-22 18:03:21 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-10-22 18:03:21 +0000 |
commit | cf1a438f1c8058a3cf6a57d9401b423f2d98e5e5 (patch) | |
tree | ffa0221bc7db3db2ad0319a00107e1606a120104 /epan/dissectors/packet-ipdc.c | |
parent | 889b4cc7acf71540690a6063981b9b541d7e95d4 (diff) |
From Josh Bailey: fix the fetch of the IPDC payload length, it's only 10
bits long.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12378 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-ipdc.c')
-rw-r--r-- | epan/dissectors/packet-ipdc.c | 9 |
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 */ |