[iperf3] Use SO_REUSEPORT instead of SO_REUSEADDR

SO_REUSEADDR is not yet supported in gVisor netstack.

Testing:
fx shell 'ifconfig eth add 172.18.0.2/16; iperf3 -4 -s'

In other window:
iperf3 -c 172.18.0.2 -P 1 -b 2M -u -4

Bug: 21546
Change-Id: I2b1fc74c7c57a1033f3dad02b3d96aa4ba3c4316
diff --git a/src/iperf_sctp.c b/src/iperf_sctp.c
index 810cac4..a7aea7f 100644
--- a/src/iperf_sctp.c
+++ b/src/iperf_sctp.c
@@ -208,7 +208,12 @@
 #endif /* IPV6_V6ONLY */
 
     opt = 1;
+    // TODO(eyalsoha): Remove this when SO_REUSEADDR is supported.
+#if defined(__Fuchsia__)
+    if (setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &opt, sizeof(opt)) < 0) {
+#else
     if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) < 0) {
+#endif
         saved_errno = errno;
         close(s);
         freeaddrinfo(res);
diff --git a/src/iperf_tcp.c b/src/iperf_tcp.c
index cb8dfef..4556644 100644
--- a/src/iperf_tcp.c
+++ b/src/iperf_tcp.c
@@ -258,7 +258,12 @@
 	}
     }
         opt = 1;
+        // TODO(eyalsoha): Remove this when SO_REUSEADDR is supported.
+#if defined(__Fuchsia__)
+        if (setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &opt, sizeof(opt)) < 0) {
+#else
         if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) < 0) {
+#endif
 	    saved_errno = errno;
             close(s);
 	    freeaddrinfo(res);
diff --git a/src/net.c b/src/net.c
index 5d630fb..85d7b04 100644
--- a/src/net.c
+++ b/src/net.c
@@ -248,7 +248,12 @@
     }
 
     opt = 1;
+    // TODO(eyalsoha): Remove this when SO_REUSEADDR is supported.
+#if defined(__Fuchsia__)
+    if (setsockopt(s, SOL_SOCKET, SO_REUSEPORT, 
+#else
     if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, 
+#endif
 		   (char *) &opt, sizeof(opt)) < 0) {
 	saved_errno = errno;
 	close(s);