From: Alberto Leiva Popper Date: Mon, 16 May 2022 22:20:56 +0000 (-0500) Subject: Employ proper API to iterate through hash table entries X-Git-Tag: 1.5.4~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5cfb2f66dd6d28ab31c5736be02c4afe336a153f;p=thirdparty%2FFORT-validator.git Employ proper API to iterate through hash table entries Found this quirk while eyeballing #83. I don't think it's going to fix the problem, but it's definitely an improvement. --- diff --git a/src/rtr/db/db_table.c b/src/rtr/db/db_table.c index cf2e795d..11eab2cb 100644 --- a/src/rtr/db/db_table.c +++ b/src/rtr/db/db_table.c @@ -254,9 +254,10 @@ add_roa_deltas(struct hashable_roa *roas1, struct hashable_roa *roas2, { struct hashable_roa *n1; /* A node from @roas1 */ struct hashable_roa *n2; /* A node from @roas2 */ + struct hashable_roa *tmp; int error; - for (n1 = roas1; n1 != NULL; n1 = n1->hh.next) { + HASH_ITER(hh, roas1, n1, tmp) { HASH_FIND(hh, roas2, &n1->data, sizeof(n1->data), n2); if (n2 == NULL) { error = deltas_add_roa(deltas, &n1->data, op);