diff --git a/src/iperf_api.c b/src/iperf_api.c index f2d6f1e..83b7629 100644 --- a/src/iperf_api.c +++ b/src/iperf_api.c @@ -1388,10 +1388,15 @@ iperf_init_stream(struct iperf_stream *sp, struct iperf_test *test) /* Set IP TOS */ if ((opt = test->settings->tos)) { if (test->settings->domain == AF_INET6) { +#ifdef IPV6_TCLASS if (setsockopt(sp->socket, IPPROTO_IPV6, IPV6_TCLASS, &opt, sizeof(opt)) < 0) { i_errno = IESETCOS; return (-1); } +#else + i_errno = IESETCOS; + return (-1); +#endif } else { if (setsockopt(sp->socket, IPPROTO_IP, IP_TOS, &opt, sizeof(opt)) < 0) { i_errno = IESETTOS;