Skip to content

Commit

Permalink
net-misc/iperf: Fix USE=-ipv6
Browse files Browse the repository at this point in the history
Fixes: https://bugs.gentoo.org/659324
Package-Manager: Portage-2.3.48, Repoman-2.3.10
  • Loading branch information
Jeroen Roovers committed Sep 1, 2018
1 parent 1b2c707 commit 0bf6e05
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
23 changes: 23 additions & 0 deletions net-misc/iperf/files/iperf-2.0.12-ipv6.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
--- a/src/Listener.cpp
+++ b/src/Listener.cpp
@@ -670,6 +670,7 @@

// Now optimize packet flow up the raw socket
// Establish the flow BPF to forward up only "connected" packets to this raw socket
+#ifdef HAVE_IPV6
if (l->sa_family == AF_INET6) {
struct in6_addr *v6peer = SockAddr_get_in6_addr(&server->peer);
struct in6_addr *v6local = SockAddr_get_in6_addr(&server->local);
@@ -682,9 +683,12 @@
WARN_errno( rc == SOCKET_ERROR, "l2 v4in6 connect ip bpf");
}
} else {
+#endif
rc = SockAddr_v4_Connect_BPF(server->mSock, ((struct sockaddr_in *)(l))->sin_addr.s_addr, ((struct sockaddr_in *)(p))->sin_addr.s_addr, ((struct sockaddr_in *)(l))->sin_port, ((struct sockaddr_in *)(p))->sin_port);
WARN_errno( rc == SOCKET_ERROR, "l2 connect ip bpf");
+#ifdef HAVE_IPV6
}
+#endif
if (rc < 0)
return -1;
else
3 changes: 3 additions & 0 deletions net-misc/iperf/iperf-2.0.12.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-
IUSE="ipv6 threads debug"

DOCS="INSTALL README"
PATCHES=(
"${FILESDIR}"/${PN}-2.0.12-ipv6.patch
)

src_configure() {
econf \
Expand Down

0 comments on commit 0bf6e05

Please sign in to comment.