diff --git a/programs/test/udp_proxy.c b/programs/test/udp_proxy.c index 11fe9bf42..6dfe446a1 100644 --- a/programs/test/udp_proxy.c +++ b/programs/test/udp_proxy.c @@ -34,9 +34,11 @@ #else #include #include +#if defined(MBEDTLS_HAVE_TIME) #include #define mbedtls_time time #define mbedtls_time_t time_t +#endif #define mbedtls_printf printf #define mbedtls_calloc calloc #define mbedtls_free free @@ -823,6 +825,7 @@ int main( int argc, char *argv[] ) get_options( argc, argv ); +#if defined(MBEDTLS_HAVE_TIME) /* * Decisions to drop/delay/duplicate packets are pseudo-random: dropping * exactly 1 in N packets would lead to problems when a flight has exactly @@ -833,11 +836,12 @@ int main( int argc, char *argv[] ) */ if( opt.seed == 0 ) { - opt.seed = (unsigned int) time( NULL ); + opt.seed = (unsigned int) mbedtls_time( NULL ); mbedtls_printf( " . Pseudo-random seed: %u\n", opt.seed ); } srand( opt.seed ); +#endif /* MBEDTLS_HAVE_TIME */ /* * 0. "Connect" to the server