summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2009-08-29 21:06:50 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2009-08-29 21:06:50 +0000
commitdf498c1f7866186dbd309d156660f9b43483e2b7 (patch)
tree333e41dc7a8e9e37f8cb4254c414123c32cb0587 /net-libs/libpcap
parentInitial commit. (diff)
downloadgentoo-2-df498c1f7866186dbd309d156660f9b43483e2b7.tar.gz
gentoo-2-df498c1f7866186dbd309d156660f9b43483e2b7.tar.bz2
gentoo-2-df498c1f7866186dbd309d156660f9b43483e2b7.zip
Bump to newer snapshot, and include poll() CPU usage fix from Ubuntu. Massively drops CPU usage for live captures again.
(Portage version: 2.2_rc40/cvs/Linux x86_64)
Diffstat (limited to 'net-libs/libpcap')
-rw-r--r--net-libs/libpcap/ChangeLog10
-rw-r--r--net-libs/libpcap/files/libpcap-1.0.1_pre20090812-poll-cpu-usage.patch27
-rw-r--r--net-libs/libpcap/libpcap-1.0.1_pre20090812.ebuild59
3 files changed, 95 insertions, 1 deletions
diff --git a/net-libs/libpcap/ChangeLog b/net-libs/libpcap/ChangeLog
index 77857561bb34..6877649a4312 100644
--- a/net-libs/libpcap/ChangeLog
+++ b/net-libs/libpcap/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for net-libs/libpcap
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-libs/libpcap/ChangeLog,v 1.122 2009/07/22 19:22:52 klausman Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-libs/libpcap/ChangeLog,v 1.123 2009/08/29 21:06:50 robbat2 Exp $
+
+*libpcap-1.0.1_pre20090812 (29 Aug 2009)
+
+ 29 Aug 2009; Robin H. Johnson <robbat2@gentoo.org>
+ +libpcap-1.0.1_pre20090812.ebuild,
+ +files/libpcap-1.0.1_pre20090812-poll-cpu-usage.patch:
+ Bump to newer snapshot, and include poll() CPU usage fix from Ubuntu.
+ Massively drops CPU usage for live captures again.
22 Jul 2009; Tobias Klausmann <klausman@gentoo.org>
libpcap-1.0.1_pre20090708.ebuild:
diff --git a/net-libs/libpcap/files/libpcap-1.0.1_pre20090812-poll-cpu-usage.patch b/net-libs/libpcap/files/libpcap-1.0.1_pre20090812-poll-cpu-usage.patch
new file mode 100644
index 000000000000..8468dc503447
--- /dev/null
+++ b/net-libs/libpcap/files/libpcap-1.0.1_pre20090812-poll-cpu-usage.patch
@@ -0,0 +1,27 @@
+https://bugs.launchpad.net/ubuntu/+source/tcpdump/+bug/369288
+
+Rediffed to apply.
+
+diff -Nuar --exclude '*.orig' --exclude '*.rej' libpcap-1.0.1-20090708.orig/pcap-linux.c libpcap-1.0.1-20090708/pcap-linux.c
+--- libpcap-1.0.1-20090708.orig/pcap-linux.c 2009-07-08 11:52:08.000000000 +0000
++++ libpcap-1.0.1-20090708/pcap-linux.c 2009-08-29 20:47:44.951806355 +0000
+@@ -2785,6 +2785,19 @@
+ handle->fd, errno, pcap_strerror(errno));
+ return -1;
+ }
++
++ /* poll() sometimes returns > 0 even in error cases
++ * and sets error-bits like POLLERR, POLLHUP, ..
++ * Are also "good" bits are possible, like POLLPRI.
++ * TODO: what's with POLLRDHUP since kernel 2.6.17?
++ */
++ if (ret > 0 && pollinfo.revents & (POLLERR | POLLHUP | POLLNVAL)) {
++ snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
++ "critical revent in poll on packet socket fd %d: 0x%4.4x",
++ handle->fd, pollinfo.revents);
++ return -1;
++ }
++
+ /* check for break loop condition on interrupted syscall*/
+ if (handle->break_loop) {
+ handle->break_loop = 0;
diff --git a/net-libs/libpcap/libpcap-1.0.1_pre20090812.ebuild b/net-libs/libpcap/libpcap-1.0.1_pre20090812.ebuild
new file mode 100644
index 000000000000..462029c15b13
--- /dev/null
+++ b/net-libs/libpcap/libpcap-1.0.1_pre20090812.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-libs/libpcap/libpcap-1.0.1_pre20090812.ebuild,v 1.1 2009/08/29 21:06:50 robbat2 Exp $
+
+EAPI=2
+inherit autotools eutils multilib toolchain-funcs
+
+DESCRIPTION="A system-independent library for user-level network packet capture"
+HOMEPAGE="http://www.tcpdump.org/"
+MY_P=${PN}-${PV/_pre/-}
+SRC_URI="mirror://gentoo/${MY_P}.tar.gz"
+S=${WORKDIR}/${MY_P}
+# SRC_URI="http://www.tcpdump.org/release/${P}.tar.gz
+# http://www.jp.tcpdump.org/release/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="bluetooth ipv6 libnl"
+
+RDEPEND="!virtual/libpcap
+ bluetooth? ( || ( net-wireless/bluez net-wireless/bluez-libs ) )
+ libnl? ( dev-libs/libnl )"
+DEPEND="${RDEPEND}
+ sys-devel/flex"
+PROVIDE="virtual/libpcap"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-1.0.0-cross-linux.patch"
+ epatch "${FILESDIR}/${PN}-1.0.1_pre20090812-poll-cpu-usage.patch"
+ echo ${PV} > VERSION # Avoid CVS in version
+ eautoreconf
+}
+
+src_configure() {
+ econf $(use_enable ipv6) \
+ $(use_with libnl) \
+ $(use_enable bluetooth)
+}
+
+src_compile() {
+ emake all shared || die "compile problem"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install install-shared || die "emake install failed"
+
+ dosym libpcap.so.${PV} /usr/$(get_libdir)/libpcap.so.1
+ dosym libpcap.so.${PV} /usr/$(get_libdir)/libpcap.so
+
+ # We need this to build pppd on G/FBSD systems
+ if [[ "${USERLAND}" == "BSD" ]]; then
+ insinto /usr/include
+ doins pcap-int.h || die "failed to install pcap-int.h"
+ fi
+
+ # We are not installing README.{Win32,aix,hpux,tru64} (bug 183057)
+ dodoc CREDITS CHANGES VERSION TODO README{,.dag,.linux,.macosx,.septel} || die
+}