changeset 5354:698ae772942e draft

Warn if the OS lacks support to lock down BPF or equivalent
author Roy Marples <roy@marples.name>
date Thu, 11 Jun 2020 15:37:33 +0100
parents ff496874348c
children 6c3a684c5a67
files src/bpf.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/bpf.c	Thu Jun 11 11:35:20 2020 +0100
+++ b/src/bpf.c	Thu Jun 11 15:37:33 2020 +0100
@@ -703,6 +703,14 @@
 		return -1;
 	return 0;
 #else
+#ifdef PRIVSEP
+#if defined(__sun) /* Solaris cannot send via BPF. */
+#elif defined(BIOCSETF)
+#warning No BIOCSETWF support - a compromised BPF can be used as a raw socket
+#else
+#warning A compromised PF_PACKET socket can be used as a raw socket
+#endif
+#endif
 	return bpf_bootp_rw(bpf, true);
 #endif
 }