On Tue, Jan 04, 2022 at 04:05:57PM +0100, Claudio Jeker wrote:
> Currently running rpki-client -n with an up to date repo results in the
> loss of around 25% of ROAs. The reason is that most of apnic fails since
> they decided it is a glorious idea to put two rsync repos into one rrdp
> repo.
>
> When changing the repo state for the noop case from REPO_DONE to
> REPO_FAILED it resulted in a unwanted side-effect. The problem is that a
> second rrdp_get() call for such a failed repo fails and so the code falls
> back to rsync but there is nothing in the rsync dir.
>
> Just change back the status to REPO_DONE and -n works like before.
ok tb
> --
> :wq Claudio
>
> Index: repo.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/rpki-client/repo.c,v
> retrieving revision 1.18
> diff -u -p -r1.18 repo.c
> --- repo.c 29 Dec 2021 11:35:23 -0000 1.18
> +++ repo.c 4 Jan 2022 14:28:41 -0000
> @@ -447,7 +447,7 @@ ta_get(struct tal *tal)
> tal->uri = NULL;
>
> if (noop) {
> - tr->state = REPO_FAILED;
> + tr->state = REPO_DONE;
> logx("ta/%s: using cache", tr->descr);
> repo_done(tr, 0);
> } else {
> @@ -512,7 +512,7 @@ rsync_get(const char *uri, int nofetch)
> rr->basedir = repo_dir(repo, "rsync", 0);
>
> if (noop || nofetch) {
> - rr->state = REPO_FAILED;
> + rr->state = REPO_DONE;
> logx("%s: using cache", rr->basedir);
> repo_done(rr, 0);
> } else {
> @@ -582,7 +582,7 @@ rrdp_get(const char *uri, int nofetch)
> RB_INIT(&rr->deleted);
>
> if (noop || nofetch) {
> - rr->state = REPO_FAILED;
> + rr->state = REPO_DONE;
> logx("%s: using cache", rr->notifyuri);
> repo_done(rr, 0);
> } else {
>