Page MenuHomeFreeBSD

D20317.id57563.diff
No OneTemporary

D20317.id57563.diff

Index: sys/netinet/netdump/netdump_client.c
===================================================================
--- sys/netinet/netdump/netdump_client.c
+++ sys/netinet/netdump/netdump_client.c
@@ -114,6 +114,8 @@
/* Must be at least as big as the chunks dumpsys() gives us. */
static unsigned char nd_buf[MAXDUMPPGS * PAGE_SIZE];
+static off_t nd_tx_offset;
+static off_t nd_buf_offset;
static uint32_t nd_seqno;
static int dump_failed, have_gw_mac;
static void (*drv_if_input)(struct ifnet *, struct mbuf *);
@@ -944,6 +946,12 @@
virtual, (uintmax_t)offset, length);
if (virtual == NULL) {
+ if (nd_buf_offset != 0) {
+ error = netdump_send(NETDUMP_VMCORE, nd_tx_offset, nd_buf, nd_buf_offset);
+ if (error != 0) {
+ dump_failed = 1;
+ }
+ }
if (dump_failed != 0)
printf("failed to dump the kernel core\n");
else if (netdump_send(NETDUMP_FINISHED, 0, NULL, 0) != 0)
@@ -956,12 +964,19 @@
if (length > sizeof(nd_buf))
return (ENOSPC);
- memmove(nd_buf, virtual, length);
- error = netdump_send(NETDUMP_VMCORE, offset, nd_buf, length);
- if (error != 0) {
- dump_failed = 1;
- return (error);
+ if (nd_buf_offset + length > sizeof(nd_buf)) {
+ error = netdump_send(NETDUMP_VMCORE, nd_tx_offset, nd_buf, nd_buf_offset);
+ if (error != 0) {
+ dump_failed = 1;
+ return (error);
+ }
+ nd_buf_offset = 0;
+ nd_tx_offset = offset;
}
+
+ memmove(nd_buf + nd_buf_offset, virtual, length);
+ nd_buf_offset += length;
+
return (0);
}

File Metadata

Mime Type
text/plain
Expires
Thu, Jan 23, 5:26 PM (7 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16059748
Default Alt Text
D20317.id57563.diff (1 KB)

Event Timeline