summaryrefslogtreecommitdiff
path: root/net/trafshow/files/patch-trafshow.c
diff options
context:
space:
mode:
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;