summaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorJan Doskočil <jan.doskocil@nic.cz>2024-08-28 19:03:14 +0200
committerJan Doskočil <jan.doskocil@nic.cz>2024-08-28 19:03:14 +0200
commitd120800adb2c056eb4351b8efd9549ff6fe2173e (patch)
tree40839cacecf94a52c59f61301875393414baad4d /src/utils
parentMerge branch 'kxdpgun_json' into 'master' (diff)
downloadknot-d120800adb2c056eb4351b8efd9549ff6fe2173e.tar.xz
knot-d120800adb2c056eb4351b8efd9549ff6fe2173e.zip
fixup! kxdpgun: add cli option for reading binary file
kxdpgun query linked list fix
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/kxdpgun/load_queries.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/utils/kxdpgun/load_queries.c b/src/utils/kxdpgun/load_queries.c
index c37065f3d..fe7c9aee7 100644
--- a/src/utils/kxdpgun/load_queries.c
+++ b/src/utils/kxdpgun/load_queries.c
@@ -135,10 +135,10 @@ static int read_txt(struct pkt_payload **g_payloads_top_p, FILE *f, txt_bufs_t *
// add pkt to list global_payloads
if (g_payloads_top == NULL) {
global_payloads = pkt;
- g_payloads_top = pkt;
+ *g_payloads_top_p = pkt;
} else {
g_payloads_top->next = pkt;
- g_payloads_top = pkt;
+ *g_payloads_top_p = pkt;
}
return pkt_len;
}
@@ -168,10 +168,10 @@ static int read_bin(struct pkt_payload **g_payloads_top_p, FILE *f, bin_bufs_t *
// add pkt to list global_payloads
if (g_payloads_top == NULL) {
global_payloads = pkt;
- g_payloads_top = pkt;
+ *g_payloads_top_p = pkt;
} else {
g_payloads_top->next = pkt;
- g_payloads_top = pkt;
+ *g_payloads_top_p = pkt;
}
return size;
}
@@ -184,7 +184,6 @@ bool load_queries(const input_t *input, uint16_t edns_size, uint16_t msgid, size
ERR2(ERR_PREFIX "file '%s' (%s)", input->path, strerror(errno));
return false;
}
- struct pkt_payload *g_payloads_top = NULL;
void *bufs = NULL;
switch (input->format) {
@@ -203,6 +202,7 @@ bool load_queries(const input_t *input, uint16_t edns_size, uint16_t msgid, size
goto fail;
}
+ struct pkt_payload *g_payloads_top = NULL;
while (read < maxcount) {
int ret = 0;
switch (input->format) {