- 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

@ -513,10 +513,11 @@ again:
lenat = (int *)target; lenat = (int *)target;
*lenat = packet_log_end; *lenat = packet_log_end;
lenat++; 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); memcpy((void *)lenat, (void *)packet_log_buffer, this_copy);
if (SCTP_PKTLOG_WRITERS_NEED_LOCK) { 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(); SCTP_IP_PKTLOG_UNLOCK();
return (this_copy + sizeof(int)); return (this_copy + sizeof(int));