Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Oct 2014 21:34:53 +0000 (UTC)
From:      Luigi Rizzo <luigi@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r272451 - head/contrib/tcpdump
Message-ID:  <201410022134.s92LYruR020094@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: luigi
Date: Thu Oct  2 21:34:52 2014
New Revision: 272451
URL: https://svnweb.freebsd.org/changeset/base/272451

Log:
  add CAP_EVENT for the libpcap device so we will be able to use
  pcap--netmap which does poll() on the file descriptor
  
  MFC after:	2 weeks

Modified:
  head/contrib/tcpdump/tcpdump.c

Modified: head/contrib/tcpdump/tcpdump.c
==============================================================================
--- head/contrib/tcpdump/tcpdump.c	Thu Oct  2 21:19:13 2014	(r272450)
+++ head/contrib/tcpdump/tcpdump.c	Thu Oct  2 21:34:52 2014	(r272451)
@@ -1533,7 +1533,12 @@ main(int argc, char **argv)
 	if (RFileName == NULL && VFileName == NULL) {
 		static const unsigned long cmds[] = { BIOCGSTATS };
 
-		cap_rights_init(&rights, CAP_IOCTL, CAP_READ);
+		/*
+		 * the various libpcap devices use a combination of
+		 * read (bpf), ioctl (bpf, netmap), poll (netmap)
+		 * so we add the relevant access rights.
+		 */
+		cap_rights_init(&rights, CAP_IOCTL, CAP_READ, CAP_EVENT);
 		if (cap_rights_limit(pcap_fileno(pd), &rights) < 0 &&
 		    errno != ENOSYS) {
 			error("unable to limit pcap descriptor");



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