diff --git a/src/iperf.h b/src/iperf.h index b5405f92d..a4ec08eab 100644 --- a/src/iperf.h +++ b/src/iperf.h @@ -432,6 +432,7 @@ extern int gerror; /* error value from getaddrinfo(3), for use in internal error /* UDP "connect" message and reply (textual value for Wireshark, etc. readability - legacy was numeric) */ #define UDP_CONNECT_MSG 0x36373839 // "6789" - legacy value was 123456789 #define UDP_CONNECT_REPLY 0x39383736 // "9876" - legacy value was 987654321 +#define LEGACY_UDP_CONNECT_MSG 123456789 // Old servers may still reply with the legacy value #define LEGACY_UDP_CONNECT_REPLY 987654321 // Old servers may still reply with the legacy value /* In Reverse mode, maximum number of packets to wait for "accept" response - to handle out of order packets */ diff --git a/src/iperf_udp.c b/src/iperf_udp.c index b697c9729..350d49551 100644 --- a/src/iperf_udp.c +++ b/src/iperf_udp.c @@ -592,9 +592,9 @@ iperf_udp_connect(struct iperf_test *test) printf("Connect received for Socket %d, sz=%d, buf=%x, i=%d, max_len_wait_for_reply=%d\n", s, sz, buf, i, max_len_wait_for_reply); } i += sz; - } while (buf != UDP_CONNECT_REPLY && buf != LEGACY_UDP_CONNECT_REPLY && i < max_len_wait_for_reply); + } while (buf != UDP_CONNECT_REPLY && buf != LEGACY_UDP_CONNECT_REPLY && buf != UDP_CONNECT_MSG && buf != LEGACY_UDP_CONNECT_MSG && i < max_len_wait_for_reply); - if (buf != UDP_CONNECT_REPLY && buf != LEGACY_UDP_CONNECT_REPLY) { + if (buf != UDP_CONNECT_REPLY && buf != LEGACY_UDP_CONNECT_REPLY && buf != UDP_CONNECT_MSG && buf != LEGACY_UDP_CONNECT_MSG) { i_errno = IESTREAMREAD; return -1; }