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.
return 0;
}
- pr_val_err("%s: VRP corrupted!", prefix);
+ 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_op_err("%s: VRP corrupted!", prefix);
+ return;
+ }
+ }
+ }
+
static int
add_router_key_delta(struct deltas *deltas, struct hashable_key *key, int op)
{