diff --git a/src/iperf_api.c b/src/iperf_api.c index 202cf2f..aa9c0ed 100644 --- a/src/iperf_api.c +++ b/src/iperf_api.c @@ -540,7 +540,7 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) {"affinity", required_argument, NULL, 'A'}, #endif {"title", required_argument, NULL, 'T'}, -#if defined(linux) +#if defined(linux) && defined(TCP_CONGESTION) {"linux-congestion", required_argument, NULL, 'C'}, #endif {"debug", no_argument, NULL, 'd'}, @@ -747,7 +747,7 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) client_flag = 1; break; case 'C': -#if defined(linux) +#if defined(linux) && defined(TCP_CONGESTION) test->congestion = strdup(optarg); client_flag = 1; #else /* linux */ diff --git a/src/iperf_tcp.c b/src/iperf_tcp.c index 9645fcd..4c8fcb8 100644 --- a/src/iperf_tcp.c +++ b/src/iperf_tcp.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2011, The Regents of the University of California, + * Copyright (c) 2009-2014, The Regents of the University of California, * through Lawrence Berkeley National Laboratory (subject to receipt of any * required approvals from the U.S. Dept. of Energy). All rights reserved. * @@ -184,7 +184,7 @@ iperf_tcp_listen(struct iperf_test *test) return -1; } } -#if defined(linux) +#if defined(linux) && defined(TCP_CONGESTION) if (test->congestion) { if (setsockopt(s, IPPROTO_TCP, TCP_CONGESTION, test->congestion, strlen(test->congestion)) < 0) { close(s); @@ -373,7 +373,7 @@ iperf_tcp_connect(struct iperf_test *test) } #endif -#if defined(linux) +#if defined(linux) && defined(TCP_CONGESTION) if (test->congestion) { if (setsockopt(s, IPPROTO_TCP, TCP_CONGESTION, test->congestion, strlen(test->congestion)) < 0) { close(s);