- The packet log needs to copy all of the buffer not to the end.

This commit is contained in:
Randall Stewart 2007-06-17 23:43:37 +00:00
parent 7e990b09e2
commit 19d8ca2eaf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=170899

View file

@ -513,10 +513,11 @@ sctp_copy_out_packet_log(uint8_t * target, int length)
lenat = (int *)target;
*lenat = packet_log_end;
lenat++;
this_copy = min((length - sizeof(int)), packet_log_end);
this_copy = min((length - sizeof(int)), SCTP_PACKET_LOG_SIZE);
memcpy((void *)lenat, (void *)packet_log_buffer, this_copy);
if (SCTP_PKTLOG_WRITERS_NEED_LOCK) {
atomic_subtract_int(&packet_log_writers, SCTP_PKTLOG_WRITERS_NEED_LOCK);
atomic_subtract_int(&packet_log_writers,
SCTP_PKTLOG_WRITERS_NEED_LOCK);
}
SCTP_IP_PKTLOG_UNLOCK();
return (this_copy + sizeof(int));