diff options
author | Job Snijders <job@cvs.openbsd.org> | 2022-05-10 07:28:44 +0000 |
---|---|---|
committer | Job Snijders <job@cvs.openbsd.org> | 2022-05-10 07:28:44 +0000 |
commit | 86ec6d969efe1cf0f6aabc9cc60252e935188120 (patch) | |
tree | 450d975d28fc74b36ac37cca74a42d7059050781 /usr.sbin/rpki-client/main.c | |
parent | b1327d5b74ed7aed9cb06fd7a3bd5a785008d600 (diff) |
Improve control flow readability by removing 'else if' stanzas
OK tb@ claudio@
Diffstat (limited to 'usr.sbin/rpki-client/main.c')
-rw-r--r-- | usr.sbin/rpki-client/main.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.sbin/rpki-client/main.c b/usr.sbin/rpki-client/main.c index 07164ec236f..4b6f2ebde71 100644 --- a/usr.sbin/rpki-client/main.c +++ b/usr.sbin/rpki-client/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.202 2022/05/04 15:21:25 tb Exp $ */ +/* $OpenBSD: main.c,v 1.203 2022/05/10 07:28:43 job Exp $ */ /* * Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org> * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> @@ -499,7 +499,8 @@ entity_process(struct ibuf *b, struct stats *st, struct vrp_tree *tree, break; } cert = cert_read(b); - if (cert->purpose == CERT_PURPOSE_CA) { + switch (cert->purpose) { + case CERT_PURPOSE_CA: /* * Process the revocation list from the * certificate *first*, since it might mark that @@ -507,11 +508,15 @@ entity_process(struct ibuf *b, struct stats *st, struct vrp_tree *tree, * process the MFT. */ queue_add_from_cert(cert); - } else if (cert->purpose == CERT_PURPOSE_BGPSEC_ROUTER) { + break; + case CERT_PURPOSE_BGPSEC_ROUTER: cert_insert_brks(brktree, cert); st->brks++; - } else + break; + default: st->certs_fail++; + break; + } cert_free(cert); break; case RTYPE_MFT: |