]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Fix fail to capture on RDMA device on FreeBSD 667/head
authorSlava Shwartsman <[email protected]>
Sun, 18 Feb 2018 09:10:26 +0000 (09:10 +0000)
committerSlava Shwartsman <[email protected]>
Thu, 22 Mar 2018 09:38:02 +0000 (09:38 +0000)
In pcap for RDMA devices, on FreeBSD where we have support for capsicum
but we don't have file descriptor for a live capture we will fail with:
"tcpdump: unable to limit pcap descriptor"
We just fail to set the proper access rights - don't fail the capture.

Signed-off-by: Slava Shwartsman <[email protected]>
Fix fail to capture on RDMA device on FreeBSD

In pcap for RDMA devices, on FreeBSD where we have support for capsicum
but we don't have file descriptor for a live capture we will fail with:
"tcpdump: unable to limit pcap descriptor"
We just fail to set the proper access rights - don't fail the capture.

Signed-off-by: Slava Shwartsman <[email protected]>
tcpdump.c

index 4ab2c2493b4e30795b9d5a800900671950eb3ea5..8147a180b08a58be194d9ed93f4697e925f49e70 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -2089,7 +2089,7 @@ DIAG_ON_CLANG(assign-enum)
        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 };
 
                /*