mirror of
https://github.com/Waujito/youtubeUnblock.git
synced 2025-12-27 01:48:07 +03:00
Update faking strategies
Use random ip4 id for frags, use sequential ip4 id for fakes
This commit is contained in:
14
types.h
14
types.h
@@ -13,6 +13,8 @@
|
||||
#include <errno.h> // IWYU pragma: export
|
||||
#include <stdint.h> // IWYU pragma: export
|
||||
#include <string.h> // IWYU pragma: export
|
||||
#include <stdlib.h> // IWYU pragma: export
|
||||
#include <sys/random.h> // IWYU pragma: export
|
||||
|
||||
#endif /* SPACES */
|
||||
|
||||
@@ -99,4 +101,16 @@
|
||||
#define NETBUF_FREE(buf) ;
|
||||
#endif
|
||||
|
||||
static inline int randint(void) {
|
||||
int rnd;
|
||||
|
||||
#ifdef KERNEL_SPACE
|
||||
get_random_bytes(&rnd, sizeof(rnd));
|
||||
#else
|
||||
rnd = random();
|
||||
#endif
|
||||
|
||||
return rnd;
|
||||
}
|
||||
|
||||
#endif /* TYPES_H */
|
||||
|
||||
Reference in New Issue
Block a user