0003-fix-non-ipv6-builds.patch 999 B

12345678910111213141516171819202122
  1. Index: iperf-2.0.12/src/Listener.cpp
  2. ===================================================================
  3. --- iperf-2.0.12.orig/src/Listener.cpp
  4. +++ iperf-2.0.12/src/Listener.cpp
  5. @@ -670,6 +670,7 @@ int Listener::L2_setup (void) {
  6. // Now optimize packet flow up the raw socket
  7. // Establish the flow BPF to forward up only "connected" packets to this raw socket
  8. +#ifdef HAVE_IPV6
  9. if (l->sa_family == AF_INET6) {
  10. struct in6_addr *v6peer = SockAddr_get_in6_addr(&server->peer);
  11. struct in6_addr *v6local = SockAddr_get_in6_addr(&server->local);
  12. @@ -682,6 +683,9 @@ int Listener::L2_setup (void) {
  13. WARN_errno( rc == SOCKET_ERROR, "l2 v4in6 connect ip bpf");
  14. }
  15. } else {
  16. +#else
  17. + {
  18. +#endif
  19. 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);
  20. WARN_errno( rc == SOCKET_ERROR, "l2 connect ip bpf");
  21. }