diff options
author | luigi <luigi@FreeBSD.org> | 2014-10-02 21:34:52 +0000 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 2014-10-02 21:34:52 +0000 |
commit | fd6ccb9306653d8adf360782851fd787151bf988 (patch) | |
tree | 84e8c67008f8ecda7e6d58e1e3ccc1712a0208a7 /contrib | |
parent | 08d8637e39fb612f67c97526df6f58f0872fb6cc (diff) | |
download | FreeBSD-src-fd6ccb9306653d8adf360782851fd787151bf988.zip FreeBSD-src-fd6ccb9306653d8adf360782851fd787151bf988.tar.gz |
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
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/tcpdump/tcpdump.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/contrib/tcpdump/tcpdump.c b/contrib/tcpdump/tcpdump.c index b2124a6..af34f88 100644 --- a/contrib/tcpdump/tcpdump.c +++ b/contrib/tcpdump/tcpdump.c @@ -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"); |