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 };
 
                /*
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to