- EXTRACT_16BITS(header_lsp->remaining_lifetime));
- /* verify the checksum -
- * checking starts at the lsp-id field
- * which is 12 bytes after the packet start*/
- printf("\n\t chksum: 0x%04x (%s), PDU length: %u",
- EXTRACT_16BITS(header_lsp->checksum),
- (osi_cksum(optr+12, length-12)) ? "incorrect" : "correct",
- pdu_len);
-
- printf(", %s", ISIS_MASK_LSP_OL_BIT(header_lsp->typeblock) ? "Overload bit set, " : "");
+ EXTRACT_16BITS(header_lsp->remaining_lifetime),
+ EXTRACT_16BITS(header_lsp->checksum));
+
+ /* if this is a purge do not attempt to verify the checksum */
+ if ( EXTRACT_16BITS(header_lsp->remaining_lifetime) == 0 &&
+ EXTRACT_16BITS(header_lsp->checksum) == 0)
+ printf(" (purged)");
+ else
+ /* verify the checksum -
+ * checking starts at the lsp-id field at byte position [12]
+ * hence the length needs to be reduced by 12 bytes */
+ printf(" (%s)", (osi_cksum((u_int8_t *)header_lsp->lsp_id, length-12)) ? "incorrect" : "correct");
+
+ printf(", PDU length: %u, Flags: [ %s",
+ pdu_len,
+ ISIS_MASK_LSP_OL_BIT(header_lsp->typeblock) ? "Overload bit set, " : "");