summaryrefslogtreecommitdiff
path: root/net/trafshow/files/patch-trafshow.c
diff options
context:
space:
mode:
authorJean-Yves Lefort <jylefort@FreeBSD.org>2006-02-01 21:14:37 +0000
committerJean-Yves Lefort <jylefort@FreeBSD.org>2006-02-01 21:14:37 +0000
commit54a0cec780c773071a56dc1ac61fe7bbfe3a0461 (patch)
treeeeec4bc8a48f995e3eff17b1c11ad12e4ee3f0ff /net/trafshow/files/patch-trafshow.c
parentFix the packing list on Perl 5.005 - s/mach/%%PERL_ARCH%%/. (diff)
- Update to 5.2.2 and improve the bpf kernel bug (kern/84823) workaround [1]
- Take maintainership [1]: PR: ports/92694 Submitted by: Rudolf Cejka <cejkar@fit.vutbr.cz>
Notes
Notes: svn path=/head/; revision=155027
Diffstat (limited to 'net/trafshow/files/patch-trafshow.c')
-rw-r--r--net/trafshow/files/patch-trafshow.c35
1 files changed, 28 insertions, 7 deletions
diff --git a/net/trafshow/files/patch-trafshow.c b/net/trafshow/files/patch-trafshow.c
index e2db3953903e..a797fa9409fc 100644
--- a/net/trafshow/files/patch-trafshow.c
+++ b/net/trafshow/files/patch-trafshow.c
@@ -1,11 +1,32 @@
---- trafshow.c.orig Mon Jul 12 07:20:41 2004
-+++ trafshow.c Mon Nov 7 22:25:56 2005
-@@ -305,7 +305,7 @@
- fprintf(stderr, "%s: %s\n", dp->name, buf);
- err++;
+--- trafshow.c.orig Sun Jan 8 08:05:29 2006
++++ trafshow.c Wed Feb 1 18:07:33 2006
+@@ -20,6 +20,7 @@
+ #endif
+ #include <sys/types.h>
+ #include <sys/socket.h>
++#include <sys/ioctl.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <signal.h>
+@@ -281,6 +282,7 @@
+ pcap_t *pd;
+ PCAP_HANDLER *ph, *ph_prev = 0;
+ char buf[256];
++ u_int v;
+
+ if (!ph_list) return -1;
+
+@@ -307,6 +309,13 @@
}
-- if (pcap_setnonblock(pd, 1, buf) < 0) {
-+ if (pcap_setnonblock(pd, 0, buf) < 0) {
+ if (pcap_setnonblock(pd, 1, buf) < 0) {
fprintf(stderr, "%s: %s\n", dp->name, buf);
++ pcap_close(pd);
++ err++;
++ continue;
++ }
++ v = 1;
++ if (ioctl(pcap_fileno(pd), BIOCIMMEDIATE, &v) < 0) {
++ fprintf(stderr, "%s: %s\n", dp->name, strerror(errno));
pcap_close(pd);
err++;
+ continue;