aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-iec104.c
diff options
context:
space:
mode:
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2009-07-10 05:40:02 +0000
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2009-07-10 05:40:02 +0000
commit82dc5d1979060f46fc69783fdb5a55ab9157e82e (patch)
tree2594528c9243a64f966adba2909ae71bbc3ada94 /epan/dissectors/packet-iec104.c
parent11f2a6f225d551dc00ebdb1c059e684aeb0c0365 (diff)
From Joan Ramio:
IEC 60870-5-104 dissector decodes nothing (new_tvb reported length bug) https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3650 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29048 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-iec104.c')
-rw-r--r--epan/dissectors/packet-iec104.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/epan/dissectors/packet-iec104.c b/epan/dissectors/packet-iec104.c
index cd2d103f1f..684398c8fc 100644
--- a/epan/dissectors/packet-iec104.c
+++ b/epan/dissectors/packet-iec104.c
@@ -76,6 +76,8 @@ static int proto_iec104asdu = -1;
/* Protocol constants */
#define APCI_START 0x68
#define APCI_LEN 6
+#define APCI_START_LEN 2
+#define APCI_DATA_LEN (APCI_LEN- APCI_START_LEN)
#define APDU_MIN_LEN 4
#define APDU_MAX_LEN 253
@@ -600,7 +602,7 @@ static void dissect_iec104apci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_str(pinfo->cinfo, COL_INFO, res->str);
if(apcih->Type == I_TYPE && Brossa != TcpLen) {
- call_dissector(iec104asdu_handle, tvb_new_subset(tvb, Off+ APCI_LEN, -1, apcih->ApduLen- APCI_LEN), pinfo, tree);
+ call_dissector(iec104asdu_handle, tvb_new_subset(tvb, Off+ APCI_LEN, -1, apcih->ApduLen- APCI_DATA_LEN), pinfo, tree);
} else {
col_set_fence(pinfo->cinfo, COL_INFO);
}
@@ -619,7 +621,7 @@ static void dissect_iec104apci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
/* Don't call ASDU dissector if it was called before */
if(apcih->Type == I_TYPE && (!check_col(pinfo->cinfo, COL_INFO))){
- call_dissector(iec104asdu_handle, tvb_new_subset(tvb, Off+ APCI_LEN, -1, apcih->ApduLen- APCI_LEN), pinfo, tree);
+ call_dissector(iec104asdu_handle, tvb_new_subset(tvb, Off+ APCI_LEN, -1, apcih->ApduLen- APCI_DATA_LEN), pinfo, tree);
}
/* 'Packet Details': TREE */
@@ -675,7 +677,7 @@ proto_register_iec104apci(void)
};
proto_iec104apci = proto_register_protocol(
- "IEC 60870-5-104,Apci",
+ "IEC 60870-5-104-Apci",
"104apci",
"104apci"
);
@@ -736,7 +738,7 @@ proto_register_iec104asdu(void)
};
proto_iec104asdu = proto_register_protocol(
- "IEC 60870-5-104,Asdu",
+ "IEC 60870-5-104-Asdu",
"104asdu",
"104asdu"
);