summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Roovers <jer@gentoo.org>2019-02-17 15:15:34 +0100
committerJeroen Roovers <jer@gentoo.org>2019-02-17 15:17:54 +0100
commite2c5f5be51b7e3144c853d05d2bd055be0074afa (patch)
tree17bb295f75ba69ace253eb9c9bfcf89007af887d /net-analyzer/fragroute
parentnet-print/cups-filters: Bump to version 1.22.1 (diff)
downloadgentoo-e2c5f5be51b7e3144c853d05d2bd055be0074afa.tar.gz
gentoo-e2c5f5be51b7e3144c853d05d2bd055be0074afa.tar.bz2
gentoo-e2c5f5be51b7e3144c853d05d2bd055be0074afa.zip
net-analyzer/fragroute: Fix pcap_open clash
Package-Manager: Portage-2.3.60, Repoman-2.3.12 Fixes: https://bugs.gentoo.org/662474 Signed-off-by: Jeroen Roovers <jer@gentoo.org>
Diffstat (limited to 'net-analyzer/fragroute')
-rw-r--r--net-analyzer/fragroute/files/fragroute-1.2.6-pcap_open.patch44
-rw-r--r--net-analyzer/fragroute/fragroute-1.2.6-r1.ebuild47
2 files changed, 91 insertions, 0 deletions
diff --git a/net-analyzer/fragroute/files/fragroute-1.2.6-pcap_open.patch b/net-analyzer/fragroute/files/fragroute-1.2.6-pcap_open.patch
new file mode 100644
index 000000000000..6dedb535d3b5
--- /dev/null
+++ b/net-analyzer/fragroute/files/fragroute-1.2.6-pcap_open.patch
@@ -0,0 +1,44 @@
+--- a/fragtest.c
++++ b/fragtest.c
+@@ -458,7 +458,7 @@
+ if ((ctx.ip = ip_open()) == NULL)
+ err(1, "couldn't open raw IP interface");
+
+- if ((ctx.pcap = pcap_open(ifent.intf_name)) == NULL)
++ if ((ctx.pcap = fragroute_pcap_open(ifent.intf_name)) == NULL)
+ err(1, "couldn't open %s for sniffing", ifent.intf_name);
+
+ if ((ctx.dloff = pcap_dloff(ctx.pcap)) < 0)
+--- a/tun-loop.c
++++ b/tun-loop.c
+@@ -331,7 +331,7 @@
+ return (tun_close(tun));
+
+ /* Set up to sniff on loopback. */
+- if ((tun->pcap = pcap_open(tun->ifent->intf_name)) == NULL)
++ if ((tun->pcap = fragroute_pcap_open(tun->ifent->intf_name)) == NULL)
+ return (tun_close(tun));
+
+ if (pcap_filter(tun->pcap, "ip dst %s", addr_ntoa(dst)) < 0)
+--- a/pcaputil.c
++++ b/pcaputil.c
+@@ -27,7 +27,7 @@
+ #include "pcaputil.h"
+
+ pcap_t *
+-pcap_open(char *device)
++fragroute_pcap_open(char *device)
+ {
+ char ebuf[PCAP_ERRBUF_SIZE];
+ pcap_t *pcap;
+--- a/pcaputil.h
++++ b/pcaputil.h
+@@ -9,7 +9,7 @@
+ #ifndef PCAPUTIL_H
+ #define PCAPUTIL_H
+
+-pcap_t *pcap_open(char *device);
++pcap_t *fragroute_pcap_open(char *device);
+ int pcap_dloff(pcap_t *pcap);
+ int pcap_filter(pcap_t *pcap, const char *fmt, ...);
+
diff --git a/net-analyzer/fragroute/fragroute-1.2.6-r1.ebuild b/net-analyzer/fragroute/fragroute-1.2.6-r1.ebuild
new file mode 100644
index 000000000000..d432afe4d5bf
--- /dev/null
+++ b/net-analyzer/fragroute/fragroute-1.2.6-r1.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+MY_P="${P}-ipv6"
+
+inherit autotools
+
+DESCRIPTION="Testing of network intrusion detection systems, firewalls and TCP/IP stacks"
+HOMEPAGE="https://github.com/stsi/fragroute-ipv6"
+SRC_URI="https://fragroute-ipv6.googlecode.com/files/${MY_P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
+
+RDEPEND="
+ dev-libs/libevent
+ net-libs/libpcap
+ >=dev-libs/libdnet-1.12[ipv6]
+"
+DEPEND="
+ ${RDEPEND}
+ virtual/awk
+"
+DOCS=( INSTALL README TODO )
+PATCHES=(
+ "${FILESDIR}"/${P}-pcap_open.patch
+)
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ default
+ # Remove broken and old files, autotools will regen needed files
+ rm *.m4 acconfig.h missing Makefile.in || die
+ # Add missing includes
+ sed -i -e "/#define IPUTIL_H/a#include <stdio.h>\n#include <stdint.h>" iputil.h || die
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --with-libdnet="${EPREFIX}"/usr \
+ --with-libevent="${EPREFIX}"/usr \
+ --with-libpcap="${EPREFIX}"/usr
+}