summaryrefslogtreecommitdiff
path: root/packet-ospf.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-10-27 00:47:26 +0000
committerGuy Harris <guy@alum.mit.edu>2001-10-27 00:47:26 +0000
commitad9f7b9566e84291bbb25a643989cc1a792866bf (patch)
tree21ff704cbd6c6562a90a282f9bff9c313fb53028 /packet-ospf.c
parente4a7740da396a900ba7ec0654d6184dabddf60e1 (diff)
downloadwireshark-ad9f7b9566e84291bbb25a643989cc1a792866bf.tar.gz
Section D.4.3 "Generating Cryptographic authentication" of RFC 2328 says
that, when using cryptographic authentication, "The checksum field in the standard OSPF header is not calculated, but is instead set to 0"; treat a packet checksum value of 0 as meaning "no checksum present". svn path=/trunk/; revision=4090
Diffstat (limited to 'packet-ospf.c')
-rw-r--r--packet-ospf.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/packet-ospf.c b/packet-ospf.c
index bdd32195be..04653c3690 100644
--- a/packet-ospf.c
+++ b/packet-ospf.c
@@ -2,7 +2,7 @@
* Routines for OSPF packet disassembly
* (c) Copyright Hannes R. Boehm <hannes@boehm.org>
*
- * $Id: packet-ospf.c,v 1.46 2001/09/14 06:30:42 guy Exp $
+ * $Id: packet-ospf.c,v 1.47 2001/10/27 00:47:26 guy Exp $
*
* At this time, this module is able to analyze OSPF
* packets as specified in RFC2328. MOSPF (RFC1584) and other
@@ -298,7 +298,11 @@ dissect_ospf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
length = tvb_length(tvb);
/* XXX - include only the length from the OSPF header? */
reported_length = tvb_reported_length(tvb);
- if (!pinfo->fragmented && length >= reported_length
+ if (cksum == 0) {
+ /* No checksum supplied in the packet. */
+ proto_tree_add_text(ospf_header_tree, tvb, 12, 2,
+ "Packet Checksum: 0x%04x (none)", cksum);
+ } else if (!pinfo->fragmented && length >= reported_length
&& length >= ospf_header_length) {
/* The packet isn't part of a fragmented datagram and isn't
truncated, so we can checksum it. */