fuzz: allow overriding LWIP_RAND for fuzz tests

Fuzz tests need reproducible code, so we need an "unsafe" version of
LWIP_RAND() in this case...

Also, to reproduce fuzz tests cases from Linux on Windows,
LWIP_RAND_FOR_FUZZ_SIMULATE_GLIBC provides the first 20 random numbers that
glibc would have...
This commit is contained in:
Simon Goldschmidt
2020-03-27 22:42:06 +01:00
parent 003f5cc12d
commit e30d50710d
3 changed files with 39 additions and 0 deletions

View File

@@ -382,6 +382,15 @@ extern "C" {
#define LWIP_PROVIDE_ERRNO
#endif
/* Use a special, reproducable version of rand() for fuzz tests? */
#ifdef LWIP_RAND_FOR_FUZZ
#ifdef LWIP_RAND
#undef LWIP_RAND
#endif
u32_t lwip_fuzz_rand(void);
#define LWIP_RAND() lwip_fuzz_rand()
#endif
/**
* @}
*/