Add test case: inject IPv4 based TCP payload packet after recv C2S first payload
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
|
||||
@@ -209,7 +210,10 @@ static inline void calc_tcp_fingerprint(struct tcp_fingerprint *finger)
|
||||
{
|
||||
#define RANGE(rand, start, end) (start + rand % (end - start + 1)) // [start, end]
|
||||
|
||||
uint64_t random = 0x013579ABCDEF ^ stellar_get_monotonic_time_msec();
|
||||
struct timespec time;
|
||||
clock_gettime(CLOCK_MONOTONIC, &time);
|
||||
|
||||
uint64_t random = 0x013579ABCDEF ^ time.tv_nsec;
|
||||
finger->ipid = (uint16_t)(RANGE(random, 32767, 65535));
|
||||
finger->ttl = (uint8_t)(RANGE(random, 48, 120));
|
||||
finger->win = (uint16_t)(RANGE(random, 1000, 1460));
|
||||
|
||||
Reference in New Issue
Block a user