svn commit: r342215 - stable/12/contrib/tcpdump

Hans Petter Selasky hselasky at FreeBSD.org
Wed Dec 19 08:49:08 UTC 2018


Author: hselasky
Date: Wed Dec 19 08:49:07 2018
New Revision: 342215
URL: https://svnweb.freebsd.org/changeset/base/342215

Log:
  MFC r341844:
  Don't register IOCTLs with capsicum when there is no valid file descriptor.
  This fixes tcpdump when using mlx5_X devices.
  
  Differential Revision:	https://reviews.freebsd.org/D18499
  Reviewed by:		kib@, slavash@, oshogbo@
  Sponsored by:		Mellanox Technologies

Modified:
  stable/12/contrib/tcpdump/tcpdump.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/tcpdump/tcpdump.c
==============================================================================
--- stable/12/contrib/tcpdump/tcpdump.c	Wed Dec 19 04:54:32 2018	(r342214)
+++ stable/12/contrib/tcpdump/tcpdump.c	Wed Dec 19 08:49:07 2018	(r342215)
@@ -1915,7 +1915,7 @@ main(int argc, char **argv)
 	if (pcap_setfilter(pd, &fcode) < 0)
 		error("%s", pcap_geterr(pd));
 #ifdef HAVE_CAPSICUM
-	if (RFileName == NULL && VFileName == NULL) {
+	if (RFileName == NULL && VFileName == NULL && pcap_fileno(pd) != -1) {
 		static const unsigned long cmds[] = { BIOCGSTATS, BIOCROTZBUF };
 
 		/*


More information about the svn-src-all mailing list