]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Fix capsicum support to work with zerocopy buffers in bpf. 486/head
authorLuiz Otavio O Souza <[email protected]>
Wed, 14 Oct 2015 15:05:24 +0000 (10:05 -0500)
committerLuiz Otavio O Souza <[email protected]>
Wed, 14 Oct 2015 15:05:24 +0000 (10:05 -0500)
Zerocopcy buffers in bpf was broken until recently in FreeBSD and now that
it is fixed, tcpdump is failing with insuficient capabilities when trying to
use the BIOCROTZBUF ioctl.

This commit adds BIOCROTZBUF to the list of allowed ioctls.

tcpdump.c

index 3fe1484480764c2649c2328501ebdcdb1ea242d1..521196ba2da48d3ad20b9e5fe71e4bbbf448f3f6 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -1555,7 +1555,7 @@ main(int argc, char **argv)
                error("%s", pcap_geterr(pd));
 #ifdef HAVE_CAPSICUM
        if (RFileName == NULL && VFileName == NULL) {
-               static const unsigned long cmds[] = { BIOCGSTATS };
+               static const unsigned long cmds[] = { BIOCGSTATS, BIOCROTZBUF };
 
                cap_rights_init(&rights, CAP_IOCTL, CAP_READ);
                if (cap_rights_limit(pcap_fileno(pd), &rights) < 0 &&