aboutsummaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2018-05-06 00:38:29 +0000
committerMark Johnston <markj@FreeBSD.org>2018-05-06 00:38:29 +0000
commite505460228ceabb9de434b8416ee2b7faaa66d1a (patch)
tree2e33aacd9c10f09b717945b802975b05ae30c370 /sys/net
parentbd92e6b6f5e6d2fa7b66753fb8ef1f3abb59418c (diff)
downloadsrc-e505460228ceabb9de434b8416ee2b7faaa66d1a.tar.gz
src-e505460228ceabb9de434b8416ee2b7faaa66d1a.zip
Import the netdump client code.
This is a component of a system which lets the kernel dump core to a remote host after a panic, rather than to a local storage device. The server component is available in the ports tree. netdump is particularly useful on diskless systems. The netdump(4) man page contains some details describing the protocol. Support for configuring netdump will be added to dumpon(8) in a future commit. To use netdump, the kernel must have been compiled with the NETDUMP option. The initial revision of netdump was written by Darrell Anderson and was integrated into Sandvine's OS, from which this version was derived. Reviewed by: bdrewery, cem (earlier versions), julian, sbruno MFC after: 1 month X-MFC note: use a spare field in struct ifnet Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D15253
Notes
Notes: svn path=/head/; revision=333283
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if.c4
-rw-r--r--sys/net/if_var.h6
2 files changed, 10 insertions, 0 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index a0016b8d9be6..588081a9bbff 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -87,6 +87,7 @@
#include <netinet/ip_carp.h>
#ifdef INET
#include <netinet/if_ether.h>
+#include <netinet/netdump/netdump.h>
#endif /* INET */
#ifdef INET6
#include <netinet6/in6_var.h>
@@ -2769,6 +2770,9 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, struct thread *td)
if (error == 0) {
getmicrotime(&ifp->if_lastchange);
rt_ifmsg(ifp);
+#ifdef INET
+ NETDUMP_REINIT(ifp);
+#endif
}
/*
* If the link MTU changed, do network layer specific procedure.
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
index 7ffb06e6ae52..c9e50a880724 100644
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -70,6 +70,7 @@ struct route; /* if_output */
struct vnet;
struct ifmedia;
struct netmap_adapter;
+struct netdump_methods;
#ifdef _KERNEL
#include <sys/mbuf.h> /* ifqueue only? */
@@ -369,6 +370,11 @@ struct ifnet {
uint8_t if_pcp;
/*
+ * Netdump hooks to be called while dumping.
+ */
+ struct netdump_methods *if_netdump_methods;
+
+ /*
* Spare fields to be added before branching a stable branch, so
* that structure can be enhanced without changing the kernel
* binary interface.