]> git.ipfire.org Git - thirdparty/FORT-validator.git/commitdiff
Patch FIXME: Fall back to snapshot when deltas fail
authorAlberto Leiva Popper <ydahhrk@gmail.com>
Thu, 9 Nov 2023 23:51:43 +0000 (17:51 -0600)
committerAlberto Leiva Popper <ydahhrk@gmail.com>
Thu, 9 Nov 2023 23:51:43 +0000 (17:51 -0600)
src/rrdp.c

index 83edc4087154efb3fa0e1c41a9d25b0e6bfe8bdd..44f9552845e67a81404d86063370f7aceb6dd4c9 100644 (file)
@@ -923,7 +923,6 @@ handle_deltas(struct update_notification *notif, struct rrdp_serial *serial)
        }
        if (BN_is_negative(diff_bn)) {
                BN_free(diff_bn);
-               /* FIXME delete RPP and fall back to snapshot */
                return pr_val_err("Cached delta's serial [%s] is larger than Notification's current serial [%s].",
                    serial->str, notif->session.serial.str);
        }
@@ -1022,6 +1021,10 @@ rrdp_update(struct rpki_uri *uri)
        if (BN_cmp(old.serial.num, new.session.serial.num) != 0) {
                pr_val_debug("The Notification's serial changed.");
                error = handle_deltas(&new, &old.serial);
+               if (error) {
+                       pr_val_debug("Falling back to snapshot.");
+                       error = handle_snapshot(&new);
+               }
                goto revert_notification;
        }