From: Alberto Leiva Popper Date: Mon, 30 Jan 2023 21:50:20 +0000 (-0600) Subject: Merge branch 'issue83' X-Git-Tag: 1.5.4~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f6d35732e8afe2c9dcddd56e41f7555d4781ae9d;p=thirdparty%2FFORT-validator.git Merge branch 'issue83' I was hesitant to put this on main because it seemed like a performance tank, but truth be told, I'm being a wuss. these table iterations are nothing compared to the amount of time Fort has to spend downloading. And it looks like I'm never going to find this bug with the stack trace alone. Does not fix #83 nor #89, but prevents the crash at least. --- f6d35732e8afe2c9dcddd56e41f7555d4781ae9d diff --cc src/rtr/db/db_table.c index f18ee15b,8fbe21ce..a0b85705 --- a/src/rtr/db/db_table.c +++ b/src/rtr/db/db_table.c @@@ -269,6 -269,25 +269,25 @@@ add_roa_deltas(struct hashable_roa *roa return 0; } + void + find_bad_vrp(char const *prefix, struct db_table *table) + { + struct hashable_roa *cursor; + struct hashable_roa *tmp; + uint8_t family; + + if (table == NULL) + return; + + HASH_ITER(hh, table->roas, cursor, tmp) { + family = cursor->data.addr_fam; + if (family != AF_INET && family != AF_INET6) { - pr_val_err("%s: VRP corrupted!", prefix); ++ pr_op_err("%s: VRP corrupted!", prefix); + return; + } + } + } + static int add_router_key_delta(struct deltas *deltas, struct hashable_key *key, int op) {