Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Dec 2018 09:51:10 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r341844 - head/contrib/tcpdump
Message-ID:  <201812120951.wBC9pAqx092589@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Wed Dec 12 09:51:10 2018
New Revision: 341844
URL: https://svnweb.freebsd.org/changeset/base/341844

Log:
  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@
  MFC after:		1 week
  Sponsored by:		Mellanox Technologies

Modified:
  head/contrib/tcpdump/tcpdump.c

Modified: head/contrib/tcpdump/tcpdump.c
==============================================================================
--- head/contrib/tcpdump/tcpdump.c	Wed Dec 12 09:03:10 2018	(r341843)
+++ head/contrib/tcpdump/tcpdump.c	Wed Dec 12 09:51:10 2018	(r341844)
@@ -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 };
 
 		/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812120951.wBC9pAqx092589>