openwrt/package/network/utils/iperf/patches/0003-fix-non-ipv6-builds.patch
Hauke Mehrtens 02d4d36d4b iperf: Update to version 2.0.13
The removed patches are already integrated in the upstream version.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2019-05-14 20:28:18 +02:00

21 lines
784 B
Diff

--- a/src/Listener.cpp
+++ b/src/Listener.cpp
@@ -723,6 +723,7 @@ int Listener::L2_setup (void) {
// 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) {
#ifdef HAVE_IPV6
struct in6_addr *v6peer = SockAddr_get_in6_addr(&server->peer);
@@ -740,6 +741,9 @@ int Listener::L2_setup (void) {
return -1;
#endif /* HAVE_IPV6 */
} else {
+#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");
}