diff --git a/libpcap/libpcap.patch b/libpcap/libpcap.patch new file mode 100644 index 0000000000..46d3af5697 --- /dev/null +++ b/libpcap/libpcap.patch @@ -0,0 +1,20 @@ +libpcap opens /dev/bpfX as O_RDONLY rather than O_RDWR. This +affects applications which open BPF using pcap_open_live(), +then get the fileno and try to use it to send packets. An +example application having this problem with BGP is UCARP +(http://www.ucarp.org/), which silently fails to send packets. +See also: http://www.freebsd.org/cgi/query-pr.cgi?pr=72814 + +Index: pcap-bpf.c +--- pcap-bpf.c.orig 2003-11-22 01:06:28 +0100 ++++ pcap-bpf.c 2004-12-09 22:57:15 +0100 +@@ -468,6 +468,8 @@ + do { + (void)snprintf(device, sizeof(device), "/dev/bpf%d", n++); +- fd = open(device, O_RDONLY); ++ fd = open(device, O_RDWR); ++ if (fd < 0 && errno == EACCES) ++ fd = open(device, O_RDONLY); + } while (fd < 0 && errno == EBUSY); + + /* diff --git a/libpcap/libpcap.spec b/libpcap/libpcap.spec index ec68bd853d..d9a3533565 100644 --- a/libpcap/libpcap.spec +++ b/libpcap/libpcap.spec @@ -34,10 +34,11 @@ Class: BASE Group: Network License: GPL Version: 0.8.3 -Release: 20040331 +Release: 20041209 # list of sources Source0: http://www.tcpdump.org/release/libpcap-%{version}.tar.gz +Patch0: libpcap.patch # build information Prefix: %{l_prefix} @@ -63,6 +64,7 @@ AutoReqProv: no %prep %setup -q + %patch -p0 %build CC="%{l_cc}" \