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
This commit is contained in:
Luigi Rizzo 2014-10-02 21:34:52 +00:00
parent 7aa1071e48
commit 884c0e1112
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=272451

View File

@ -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");