- /*
- * Make a copy of the packet, so we don't overwrite the
- * original.
- */
- ND_TCHECK2(*optr, packet_len);
- packet_copy = malloc(packet_len);
- if (packet_copy == NULL)
- sigcheck = CANT_ALLOCATE_COPY;
- else {
- struct isis_lsp_header *header_lsp_copy;
- u_int8_t *tptr_copy;
-
- memcpy(packet_copy, optr, packet_len);
-
- /*
- * Clear checksum and lifetime in the copy prior to
- * signature verification.
- */
- header_lsp_copy = (struct isis_lsp_header *)(packet_copy + ISIS_COMMON_HEADER_SIZE);
- header_lsp_copy->checksum[0] = 0;
- header_lsp_copy->checksum[1] = 0;
- header_lsp_copy->remaining_lifetime[0] = 0;
- header_lsp_copy->remaining_lifetime[1] = 0;
-
- tptr_copy = packet_copy + (tptr - optr);
- sigcheck = signature_verify(ndo, packet_copy, length,
- tptr_copy + 1);
- free(packet_copy);
- }
+ sigcheck = signature_verify(ndo, optr, length, tptr + 1,
+ isis_clear_checksum_lifetime,
+ header_lsp);