diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2021-12-21 16:16:16 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2021-12-21 16:16:16 +0000 |
commit | 1ccf42103a53707161e2452a5be2ac177f7b6153 (patch) | |
tree | 53568b8dd420468349f8eb7bde393fb954fd5164 /usr.sbin/rpki-client | |
parent | cfb0bde0cea0ddf8b81c900becbd039ffb3370f4 (diff) |
Simplify code a bit. There is only one TA per TAL and so only one
ta_lookup(). Implementing the talrepocnt limiter there makes little
sense and gains us nothing.
OK job@
Diffstat (limited to 'usr.sbin/rpki-client')
-rw-r--r-- | usr.sbin/rpki-client/repo.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/usr.sbin/rpki-client/repo.c b/usr.sbin/rpki-client/repo.c index 3a5a32eb7a7..a9badbfeab1 100644 --- a/usr.sbin/rpki-client/repo.c +++ b/usr.sbin/rpki-client/repo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: repo.c,v 1.15 2021/12/07 12:46:47 claudio Exp $ */ +/* $OpenBSD: repo.c,v 1.16 2021/12/21 16:16:15 claudio Exp $ */ /* * Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org> * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> @@ -381,7 +381,7 @@ ta_fetch(struct tarepo *tr) } static struct tarepo * -ta_get(struct tal *tal, int nofetch) +ta_get(struct tal *tal) { struct tarepo *tr; @@ -405,7 +405,7 @@ ta_get(struct tal *tal, int nofetch) tal->urisz = 0; tal->uri = NULL; - if (noop || nofetch) { + if (noop) { tr->state = REPO_DONE; logx("ta/%s: using cache", tr->descr); /* there is nothing in the queue so no need to flush */ @@ -1087,7 +1087,6 @@ struct repo * ta_lookup(int id, struct tal *tal) { struct repo *rp; - int nofetch = 0; /* Look up in repository table. (Lookup should actually fail here) */ SLIST_FOREACH(rp, &repos, entry) { @@ -1099,13 +1098,7 @@ ta_lookup(int id, struct tal *tal) if ((rp->repouri = strdup(tal->descr)) == NULL) err(1, NULL); - if (++talrepocnt[id] >= MAX_REPO_PER_TAL) { - if (talrepocnt[id] == MAX_REPO_PER_TAL) - warnx("too many repositories under %s", tals[id]); - nofetch = 1; - } - - rp->ta = ta_get(tal, nofetch); + rp->ta = ta_get(tal); return rp; } |