From: Alberto Leiva Popper Date: Mon, 6 Feb 2023 17:57:20 +0000 (-0600) Subject: Final tweaks to #83/#89 (for release 1.5.4) X-Git-Tag: 1.5.4~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da39bc61c0c920157ddd7a8da271c6a004655eee;p=thirdparty%2FFORT-validator.git Final tweaks to #83/#89 (for release 1.5.4) 1. Revert panic back into the code. - Fort SHOULD die as soon as it realizes the VRP table is corrupted, as we should not send garbage to the routers. - Also, I'm not entirely sure the code would not crash later anyway, since the table is, in fact, corrupted. - Plus, if it doesn't crash, there would be no core dump to further analyze the bug. 2. Point bug output to the currently active bug report Might help us get some output earlier. --- diff --git a/src/output_printer.c b/src/output_printer.c index 31506894..570ef2f2 100644 --- a/src/output_printer.c +++ b/src/output_printer.c @@ -48,10 +48,8 @@ print_roa_csv(struct vrp const *vrp, void *arg) { FILE *out = arg; - if (vrp->addr_fam != AF_INET && vrp->addr_fam != AF_INET6) { - /* pr_crit("Unknown family type"); TODO (issue83) */ - return 0; - } + if (vrp->addr_fam != AF_INET && vrp->addr_fam != AF_INET6) + pr_crit("Unknown family type"); fprintf(out, "AS%u,%s/%u,%u\n", vrp->asn, inet_ntop(vrp->addr_fam, &vrp->prefix, addr_buf, INET6_ADDRSTRLEN), diff --git a/src/rtr/db/db_table.c b/src/rtr/db/db_table.c index 96fdb741..2f6cbe3a 100644 --- a/src/rtr/db/db_table.c +++ b/src/rtr/db/db_table.c @@ -274,7 +274,8 @@ find_bad_vrp(char const *prefix, struct db_table *table) HASH_ITER(hh, table->roas, node, tmp) { vrp = &node->data; if (vrp->addr_fam != AF_INET && vrp->addr_fam != AF_INET6) { - pr_op_err("%s: VRP corrupted! [%u %s/%u-%u %u] %u/%u", + pr_crit("%s: VRP corrupted! [%u %s/%u-%u %u] %u/%u " + "(Please report this output to https://github.com/NICMx/FORT-validator/issues/89)", prefix, vrp->asn, addr2str6(&vrp->prefix.v6, buffer), @@ -283,7 +284,6 @@ find_bad_vrp(char const *prefix, struct db_table *table) vrp->addr_fam, roa_counter, roa_count); - return; } roa_counter++; } diff --git a/src/rtr/db/delta.c b/src/rtr/db/delta.c index 58e049d6..ec412468 100644 --- a/src/rtr/db/delta.c +++ b/src/rtr/db/delta.c @@ -141,7 +141,8 @@ deltas_add_roa(struct deltas *deltas, struct vrp const *vrp, int op, return deltas_v6_add(get_deltas_array6(deltas, op), &delta.v6); } - pr_val_err("Unknown protocol: [%u %s/%u-%u %u] %c %u/%u", + pr_crit("Unknown protocol: [%u %s/%u-%u %u] %c %u/%u " + "(Please report this output to https://github.com/NICMx/FORT-validator/issues/89)", vrp->asn, addr2str6(&vrp->prefix.v6, buffer), vrp->prefix_length, @@ -150,7 +151,6 @@ deltas_add_roa(struct deltas *deltas, struct vrp const *vrp, int op, r1type, roa_counter, roa_count); - return 0; } int