|
60 | 60 | #include <sys/cpuset.h> |
61 | 61 | #endif /* HAVE_CPUSET_SETAFFINITY */ |
62 | 62 |
|
| 63 | +#if defined(HAVE_IP_BOUND_IF) |
| 64 | +#include <netinet/in.h> |
| 65 | +#endif |
| 66 | + |
63 | 67 | #if defined(__CYGWIN__) || defined(_WIN32) || defined(_WIN64) || defined(__WINDOWS__) |
64 | 68 | #define CPU_SETSIZE __CPU_SETSIZE |
65 | 69 | #endif /* __CYGWIN__, _WIN32, _WIN64, __WINDOWS__ */ |
@@ -1125,9 +1129,9 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) |
1125 | 1129 | {"bidir", no_argument, NULL, OPT_BIDIRECTIONAL}, |
1126 | 1130 | {"window", required_argument, NULL, 'w'}, |
1127 | 1131 | {"bind", required_argument, NULL, 'B'}, |
1128 | | -#if defined(HAVE_SO_BINDTODEVICE) |
| 1132 | +#if defined(CAN_BIND_TO_DEVICE) |
1129 | 1133 | {"bind-dev", required_argument, NULL, OPT_BIND_DEV}, |
1130 | | -#endif /* HAVE_SO_BINDTODEVICE */ |
| 1134 | +#endif /* CAN_BIND_TO_DEVICE */ |
1131 | 1135 | {"cport", required_argument, NULL, OPT_CLIENT_PORT}, |
1132 | 1136 | {"set-mss", required_argument, NULL, 'M'}, |
1133 | 1137 | {"no-delay", no_argument, NULL, 'N'}, |
@@ -1301,16 +1305,16 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) |
1301 | 1305 |
|
1302 | 1306 | char *arg = strdup(optarg); |
1303 | 1307 | if (iperf_parse_hostname(test, arg, &p, &p1)) { |
1304 | | -#if defined(HAVE_SO_BINDTODEVICE) |
| 1308 | +#if defined(CAN_BIND_TO_DEVICE) |
1305 | 1309 | /* Get rid of the hostname we saved earlier. */ |
1306 | 1310 | free(iperf_get_test_server_hostname(test)); |
1307 | 1311 | iperf_set_test_server_hostname(test, p); |
1308 | 1312 | iperf_set_test_bind_dev(test, p1); |
1309 | | -#else /* HAVE_SO_BINDTODEVICE */ |
| 1313 | +#else /* CAN_BIND_TO_DEVICE */ |
1310 | 1314 | free(arg); |
1311 | 1315 | i_errno = IEBINDDEVNOSUPPORT; |
1312 | 1316 | return -1; |
1313 | | -#endif /* HAVE_SO_BINDTODEVICE */ |
| 1317 | +#endif /* CAN_BIND_TO_DEVICE */ |
1314 | 1318 | } |
1315 | 1319 | free(arg); |
1316 | 1320 | break; |
@@ -1452,25 +1456,25 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv) |
1452 | 1456 |
|
1453 | 1457 | char *arg = strdup(optarg); |
1454 | 1458 | if (iperf_parse_hostname(test, arg, &p, &p1)) { |
1455 | | -#if defined(HAVE_SO_BINDTODEVICE) |
| 1459 | +#if defined(CAN_BIND_TO_DEVICE) |
1456 | 1460 | /* Get rid of the hostname we saved earlier. */ |
1457 | 1461 | free(iperf_get_test_bind_address(test)); |
1458 | 1462 | iperf_set_test_bind_address(test, p); |
1459 | 1463 | iperf_set_test_bind_dev(test, p1); |
1460 | | -#else /* HAVE_SO_BINDTODEVICE */ |
| 1464 | +#else /* CAN_BIND_TO_DEVICE */ |
1461 | 1465 | free(arg); |
1462 | 1466 | i_errno = IEBINDDEVNOSUPPORT; |
1463 | 1467 | return -1; |
1464 | | -#endif /* HAVE_SO_BINDTODEVICE */ |
| 1468 | +#endif /* CAN_BIND_TO_DEVICE */ |
1465 | 1469 | } |
1466 | 1470 | free(arg); |
1467 | 1471 | break; |
1468 | 1472 | } |
1469 | | -#if defined (HAVE_SO_BINDTODEVICE) |
| 1473 | +#if defined(CAN_BIND_TO_DEVICE) |
1470 | 1474 | case OPT_BIND_DEV: |
1471 | 1475 | iperf_set_test_bind_dev(test, optarg); |
1472 | 1476 | break; |
1473 | | -#endif /* HAVE_SO_BINDTODEVICE */ |
| 1477 | +#endif /* CAN_BIND_TO_DEVICE */ |
1474 | 1478 | case OPT_CLIENT_PORT: |
1475 | 1479 | portno = atoi(optarg); |
1476 | 1480 | if (portno < 1 || portno > 65535) { |
|
0 commit comments