diff options
author | jylefort <jylefort@FreeBSD.org> | 2006-02-02 05:14:37 +0800 |
---|---|---|
committer | jylefort <jylefort@FreeBSD.org> | 2006-02-02 05:14:37 +0800 |
commit | 0765fbb3a29f8f328fa4ba54258385cb672ee597 (patch) | |
tree | 7acd6634514a8cff5aa41d37a267a6248434bcc8 /net/trafshow/files | |
parent | af20d06e17f4c72570bb61437b37b880734457e2 (diff) | |
download | freebsd-ports-graphics-0765fbb3a29f8f328fa4ba54258385cb672ee597.tar.gz freebsd-ports-graphics-0765fbb3a29f8f328fa4ba54258385cb672ee597.tar.zst freebsd-ports-graphics-0765fbb3a29f8f328fa4ba54258385cb672ee597.zip |
- 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>
Diffstat (limited to 'net/trafshow/files')
-rw-r--r-- | net/trafshow/files/patch-show_dump.c | 31 | ||||
-rw-r--r-- | net/trafshow/files/patch-trafshow.c | 35 |
2 files changed, 59 insertions, 7 deletions
diff --git a/net/trafshow/files/patch-show_dump.c b/net/trafshow/files/patch-show_dump.c new file mode 100644 index 00000000000..6e7fc4bbfc3 --- /dev/null +++ b/net/trafshow/files/patch-show_dump.c @@ -0,0 +1,31 @@ +--- show_dump.c.orig Mon Jul 12 07:21:09 2004 ++++ show_dump.c Wed Feb 1 18:07:01 2006 +@@ -21,6 +21,7 @@ + #include <sys/param.h> + #include <sys/types.h> + #include <sys/socket.h> ++#include <sys/ioctl.h> + #include <sys/time.h> + #include <netinet/in.h> + #include <arpa/inet.h> +@@ -118,6 +119,7 @@ + bpf_u_int32 net; + bpf_u_int32 mask; + char name[100], buf[256]; ++ u_int v; + + /* sanity check */ + if (!ph || !ns) return -1; +@@ -141,6 +143,12 @@ + if (!live_pcap) return -1; + if (pcap_setnonblock(live_pcap, 1, buf) < 0) { + screen_status("%s: %s", ph->name, buf); ++ show_dump_close(); ++ return -1; ++ } ++ v = 1; ++ if (ioctl(pcap_fileno(live_pcap), BIOCIMMEDIATE, &v) < 0) { ++ screen_status("%s: %s", ph->name, strerror(errno)); + show_dump_close(); + return -1; + } diff --git a/net/trafshow/files/patch-trafshow.c b/net/trafshow/files/patch-trafshow.c index e2db3953903..a797fa9409f 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; |