From: Daniel Salzman Date: Tue, 18 Aug 2020 18:11:26 +0000 (+0200) Subject: kxdpgun: make TRANSACTION_ID random but constant per program execution X-Git-Tag: v3.0.0~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=997f0c79fdba0eb3d74e684746e189f02bc690ee;p=thirdparty%2Fknot-dns.git kxdpgun: make TRANSACTION_ID random but constant per program execution --- diff --git a/src/utils/kxdpgun/main.c b/src/utils/kxdpgun/main.c index 52818eac11..c77a0aa4af 100644 --- a/src/utils/kxdpgun/main.c +++ b/src/utils/kxdpgun/main.c @@ -43,7 +43,7 @@ #define PROGRAM_NAME "kxdpgun" -#define TRANSACTION_ID htobe16(0xbaf8) // entirely arbitrary magic constant to distinguish from other traffic +uint16_t TRANSACTION_ID; // random constant to distinguish foreign replies volatile bool xdp_trigger = false; @@ -625,6 +625,8 @@ int main(int argc, char *argv[]) return EXIT_FAILURE; } + TRANSACTION_ID = time(NULL) % UINT16_MAX; + thread_ctxs = calloc(ctx.n_threads, sizeof(*thread_ctxs)); threads = calloc(ctx.n_threads, sizeof(*threads)); if (thread_ctxs == NULL || threads == NULL) {