aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-isis-lsp.c
diff options
context:
space:
mode:
authorJaap Keuter <jaap.keuter@xs4all.nl>2009-01-12 22:05:37 +0000
committerJaap Keuter <jaap.keuter@xs4all.nl>2009-01-12 22:05:37 +0000
commitf7a3456580f37f4baf573f490f0c49bee74d642b (patch)
tree3aaafae401636a9179926b5ab0f113926636e4ff /epan/dissectors/packet-isis-lsp.c
parent69463d1fd05228f920ae516dc0cc5db6b8a1ee9f (diff)
Fix bug 3181:
The standard ISO10589 states that the checksum check is always succesful for zero lifetime LSP. We fake it as not being used in that case. svn path=/trunk/; revision=27213
Diffstat (limited to 'epan/dissectors/packet-isis-lsp.c')
-rw-r--r--epan/dissectors/packet-isis-lsp.c51
1 files changed, 26 insertions, 25 deletions
diff --git a/epan/dissectors/packet-isis-lsp.c b/epan/dissectors/packet-isis-lsp.c
index f3171d1dcb..f4867bddee 100644
--- a/epan/dissectors/packet-isis-lsp.c
+++ b/epan/dissectors/packet-isis-lsp.c
@@ -1778,7 +1778,7 @@ isis_dissect_isis_lsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
{
proto_item *ti, *to, *ta;
proto_tree *lsp_tree = NULL, *info_tree, *att_tree;
- guint16 pdu_length, checksum, cacl_checksum=0;
+ guint16 pdu_length, lifetime, checksum, cacl_checksum=0;
guint8 lsp_info, lsp_att;
int len, offset_checksum;
proto_item *it_cksum;
@@ -1800,6 +1800,7 @@ isis_dissect_isis_lsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
proto_tree_add_item(lsp_tree, hf_isis_lsp_remaining_life,
tvb, offset, 2, FALSE);
}
+ lifetime = tvb_get_ntohs(tvb, offset);
offset += 2;
offset_checksum = offset;
@@ -1829,33 +1830,33 @@ isis_dissect_isis_lsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o
offset += 4;
if (tree) {
- checksum = tvb_get_ntohs(tvb, offset);
+ checksum = lifetime ? tvb_get_ntohs(tvb, offset) : 0;
switch (check_and_get_checksum(tvb, offset_checksum, pdu_length-12, checksum, offset, &cacl_checksum))
{
-
- case NO_CKSUM :
- proto_tree_add_uint_format(lsp_tree, hf_isis_lsp_checksum, tvb, offset, 2, checksum,
+ case NO_CKSUM :
+ checksum = tvb_get_ntohs(tvb, offset);
+ proto_tree_add_uint_format(lsp_tree, hf_isis_lsp_checksum, tvb, offset, 2, checksum,
"Checksum: 0x%04x [unused]", checksum);
- break;
- case DATA_MISSING :
- isis_dissect_unknown(tvb, tree, offset,
- "[packet length %d went beyond packet]",
- tvb_length_remaining(tvb, offset_checksum));
- break;
- case CKSUM_NOT_OK :
- it_cksum = proto_tree_add_uint_format(lsp_tree, hf_isis_lsp_checksum, tvb, offset, 2, checksum,
- "Checksum: 0x%04x [incorrect, should be 0x%04x]",
- checksum, cacl_checksum);
- isis_lsp_checkum_additional_info(tvb, pinfo, it_cksum, offset, FALSE);
- break;
- case CKSUM_OK :
- it_cksum = proto_tree_add_uint_format(lsp_tree, hf_isis_lsp_checksum, tvb, offset, 2, checksum,
- "Checksum: 0x%04x [correct]", checksum);
- isis_lsp_checkum_additional_info(tvb, pinfo, it_cksum, offset, TRUE);
- break;
- default :
- g_message("'check_and_get_checksum' returned an invalid value");
- }
+ break;
+ case DATA_MISSING :
+ isis_dissect_unknown(tvb, tree, offset,
+ "[packet length %d went beyond packet]",
+ tvb_length_remaining(tvb, offset_checksum));
+ break;
+ case CKSUM_NOT_OK :
+ it_cksum = proto_tree_add_uint_format(lsp_tree, hf_isis_lsp_checksum, tvb, offset, 2, checksum,
+ "Checksum: 0x%04x [incorrect, should be 0x%04x]",
+ checksum, cacl_checksum);
+ isis_lsp_checkum_additional_info(tvb, pinfo, it_cksum, offset, FALSE);
+ break;
+ case CKSUM_OK :
+ it_cksum = proto_tree_add_uint_format(lsp_tree, hf_isis_lsp_checksum, tvb, offset, 2, checksum,
+ "Checksum: 0x%04x [correct]", checksum);
+ isis_lsp_checkum_additional_info(tvb, pinfo, it_cksum, offset, TRUE);
+ break;
+ default :
+ g_message("'check_and_get_checksum' returned an invalid value");
+ }
}
offset += 2;