diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-01-24 03:33:35 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-01-24 03:33:35 +0000 |
commit | f2246ebb65b7640ecf7e17a974ef4521427dca47 (patch) | |
tree | 0e9b2b89c52b9e6ccceab293202cf1051f4b1c5f /packet-osi.c | |
parent | 9d4c965c819bf9ff2e979db0fb18dd3d8d3cfd4c (diff) | |
download | wireshark-f2246ebb65b7640ecf7e17a974ef4521427dca47.tar.gz wireshark-f2246ebb65b7640ecf7e17a974ef4521427dca47.tar.bz2 wireshark-f2246ebb65b7640ecf7e17a974ef4521427dca47.zip |
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.
svn path=/trunk/; revision=1530
Diffstat (limited to 'packet-osi.c')
-rw-r--r-- | packet-osi.c | 10 |
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 */ |