From: job Date: Wed, 26 Apr 2023 17:59:00 +0000 (+0000) Subject: Make -A also apply to the JSON output X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=8f9af407422049702295eca4a6263344fd639045;p=openbsd Make -A also apply to the JSON output OK claudio@ --- diff --git a/usr.sbin/rpki-client/output-json.c b/usr.sbin/rpki-client/output-json.c index 28375f096fd..9a3f6277931 100644 --- a/usr.sbin/rpki-client/output-json.c +++ b/usr.sbin/rpki-client/output-json.c @@ -1,4 +1,4 @@ -/* $OpenBSD: output-json.c,v 1.33 2023/04/26 16:32:41 claudio Exp $ */ +/* $OpenBSD: output-json.c,v 1.34 2023/04/26 17:59:00 job Exp $ */ /* * Copyright (c) 2019 Claudio Jeker * @@ -148,7 +148,10 @@ output_aspa(FILE *out, struct vap_tree *vaps) struct vap *v; int first; - if (fprintf(out, "\n\t],\n\n\t\"provider_authorizations\": {\n" + if (excludeaspa) + return 0; + + if (fprintf(out, ",\n\n\t\"provider_authorizations\": {\n" "\t\t\"ipv4\": [\n") < 0) return -1; @@ -234,6 +237,9 @@ output_json(FILE *out, struct vrp_tree *vrps, struct brk_tree *brks, return -1; } + if (fprintf(out, "\n\t]") < 0) + return -1; + if (output_aspa(out, vaps) < 0) return -1;