]> git.ipfire.org Git - thirdparty/FORT-validator.git/commitdiff
Final tweaks to #83/#89 (for release 1.5.4)
authorAlberto Leiva Popper <ydahhrk@gmail.com>
Mon, 6 Feb 2023 17:57:20 +0000 (11:57 -0600)
committerAlberto Leiva Popper <ydahhrk@gmail.com>
Mon, 6 Feb 2023 19:32:51 +0000 (13:32 -0600)
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.

src/output_printer.c
src/rtr/db/db_table.c
src/rtr/db/delta.c

index 315068947eff401dd4d95ae061b0a294a0f39bd8..570ef2f2e1ea26d030112677062a98ca32fe316d 100644 (file)
@@ -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),
index 96fdb741db08c0e106e9937b9c633626b87a2ff7..2f6cbe3abb08052ef029d0e0881f015b9a705f11 100644 (file)
@@ -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++;
        }
index 58e049d6f0821bceada476acac557fffb906d52c..ec412468764a360e30bc0b2cfd9547fc91aa60ff 100644 (file)
@@ -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