summaryrefslogtreecommitdiff
path: root/packet-ip.c
diff options
context:
space:
mode:
authorOlivier Abad <oabad@noos.fr>2000-02-02 22:07:38 +0000
committerOlivier Abad <oabad@noos.fr>2000-02-02 22:07:38 +0000
commitc2943128fc4e532537b5b701f7db5a6eec61b36b (patch)
tree372eb4c544d7455562e10f3a7817168ea603b08b /packet-ip.c
parent16fbabe46f06cd416663ff7b9ddb9d1dd2d222f5 (diff)
downloadwireshark-c2943128fc4e532537b5b701f7db5a6eec61b36b.tar.gz
In dissect_ipopt_timestamp() :
Correct a bug reported by Paul Ionescu when dissecting a timestamp IP option. The offsets where not correct. svn path=/trunk/; revision=1596
Diffstat (limited to 'packet-ip.c')
-rw-r--r--packet-ip.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/packet-ip.c b/packet-ip.c
index df68f17871..71930ecfb8 100644
--- a/packet-ip.c
+++ b/packet-ip.c
@@ -1,7 +1,7 @@
/* packet-ip.c
* Routines for IP and miscellaneous IP protocol packet disassembly
*
- * $Id: packet-ip.c,v 1.71 2000/01/24 04:44:35 guy Exp $
+ * $Id: packet-ip.c,v 1.72 2000/02/02 22:07:38 oabad Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -526,25 +526,18 @@ dissect_ipopt_timestamp(const ip_tcp_opt *optp, const u_char *opd,
while (optlen > 0) {
if (flg == IPOPT_TS_TSANDADDR) {
- if (optlen < 4) {
- proto_tree_add_text(field_tree, offset + optoffset, optlen,
- "(suboption would go past end of option)");
- break;
- }
/* XXX - check whether it goes past end of packet */
- ts = pntohl(opd);
- opd += 4;
- optlen -= 4;
- if (optlen < 4) {
+ if (optlen < 8) {
proto_tree_add_text(field_tree, offset + optoffset, optlen,
"(suboption would go past end of option)");
break;
}
- /* XXX - check whether it goes past end of packet */
memcpy((char *)&addr, (char *)opd, sizeof(addr));
opd += 4;
- optlen -= 4;
- proto_tree_add_text(field_tree, offset, 8,
+ ts = pntohl(opd);
+ opd += 4;
+ optlen -= 8;
+ proto_tree_add_text(field_tree, offset + optoffset, 8,
"Address = %s, time stamp = %u",
((addr.s_addr == 0) ? "-" : (char *)get_hostname(addr.s_addr)),
ts);