aboutsummaryrefslogtreecommitdiffstats
path: root/packet-osi.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2000-01-24 03:33:35 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2000-01-24 03:33:35 +0000
commit63b2404ddfdf4276d08fe79d95c4417a5013fb11 (patch)
tree0e9b2b89c52b9e6ccceab293202cf1051f4b1c5f /packet-osi.c
parentd60c252ae5ccecefd8b112042b0244b0ef818a38 (diff)
Fix a bunch of dissectors to use "pi.captured_len" rather than
"fd->cap_len" for the frame length - or to use macros such as "BYTES_ARE_IN_FRAME()", "IS_DATA_IN_FRAME()", and "END_OF_FRAME", which use "pi.captured_len" - so that they correctly handle frames where the actual data length of the packet is less than the size of the raw frame, e.g. with encapsulations such as ISL. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1530 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-osi.c')
-rw-r--r--packet-osi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/packet-osi.c b/packet-osi.c
index 891d5f71d4..1026af5dc2 100644
--- a/packet-osi.c
+++ b/packet-osi.c
@@ -1,7 +1,7 @@
/* packet-osi.c
* Routines for ISO/OSI network and transport protocol packet disassembly
*
- * $Id: packet-osi.c,v 1.17 2000/01/20 19:16:33 guy Exp $
+ * $Id: packet-osi.c,v 1.18 2000/01/24 03:33:31 guy Exp $
* Laurent Deniel <deniel@worldnet.fr>
*
* Ethereal - Network traffic analyzer
@@ -1354,7 +1354,7 @@ void dissect_cotp(const u_char *pd, int offset, frame_data *fd,
int status = -1;
if (((li = pd[offset + P_LI]) == 0) ||
- (offset + P_LI + li + 1 > fd->cap_len)) {
+ (!BYTES_ARE_IN_FRAME(offset, P_LI + li + 1))) {
dissect_data(pd, offset, fd, tree);
return;
}
@@ -1462,7 +1462,7 @@ void dissect_clnp(const u_char *pd, int offset, frame_data *fd,
return;
}
- if (fd->cap_len < offset + sizeof(clnp)) {
+ if (!BYTES_ARE_IN_FRAME(offset, sizeof(clnp))) {
dissect_data(pd, offset, fd, tree);
return;
}
@@ -1510,7 +1510,7 @@ void dissect_clnp(const u_char *pd, int offset, frame_data *fd,
/* stop here if header is not complete */
- if (fd->cap_len < offset + clnp.cnf_hdr_len) {
+ if (!BYTES_ARE_IN_FRAME(offset, clnp.cnf_hdr_len)) {
dissect_data(pd, offset, fd, tree);
return;
}
@@ -1577,7 +1577,7 @@ void dissect_clnp(const u_char *pd, int offset, frame_data *fd,
offset = first_offset + clnp.cnf_hdr_len;
- if (offset == fd->cap_len)
+ if (!IS_DATA_IN_FRAME(offset))
return;
/* continue with COTP if any */