Skip to content

Commit

Permalink
Final tweaks to #83/#89 (for release 1.5.4)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ydahhrk committed Feb 6, 2023
1 parent b027fb4 commit da39bc6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
6 changes: 2 additions & 4 deletions src/output_printer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions src/rtr/db/db_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -283,7 +284,6 @@ find_bad_vrp(char const *prefix, struct db_table *table)
vrp->addr_fam,
roa_counter,
roa_count);
return;
}
roa_counter++;
}
Expand Down
4 changes: 2 additions & 2 deletions src/rtr/db/delta.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -150,7 +151,6 @@ deltas_add_roa(struct deltas *deltas, struct vrp const *vrp, int op,
r1type,
roa_counter,
roa_count);
return 0;
}

int
Expand Down

0 comments on commit da39bc6

Please sign in to comment.