diff options
Diffstat (limited to 'usr.sbin/rpki-client/output-bird.c')
-rw-r--r-- | usr.sbin/rpki-client/output-bird.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.sbin/rpki-client/output-bird.c b/usr.sbin/rpki-client/output-bird.c index 0d0ce3d5e29..217f73e5bd2 100644 --- a/usr.sbin/rpki-client/output-bird.c +++ b/usr.sbin/rpki-client/output-bird.c @@ -1,4 +1,4 @@ -/* $OpenBSD: output-bird.c,v 1.10 2020/09/12 15:46:48 claudio Exp $ */ +/* $OpenBSD: output-bird.c,v 1.11 2021/04/19 17:04:35 deraadt Exp $ */ /* * Copyright (c) 2019 Claudio Jeker <claudio@openbsd.org> * Copyright (c) 2020 Robert Scheck <robert@fedoraproject.org> @@ -24,7 +24,6 @@ int output_bird1v4(FILE *out, struct vrp_tree *vrps, struct stats *st) { extern const char *bird_tablename; - char buf[64]; struct vrp *v; if (outputheader(out, st) < 0) @@ -34,6 +33,8 @@ output_bird1v4(FILE *out, struct vrp_tree *vrps, struct stats *st) return -1; RB_FOREACH(v, vrp_tree, vrps) { + char buf[64]; + if (v->afi == AFI_IPV4) { ip_addr_print(&v->addr, v->afi, buf, sizeof(buf)); if (fprintf(out, "\troa %s max %u as %u;\n", buf, @@ -51,7 +52,6 @@ int output_bird1v6(FILE *out, struct vrp_tree *vrps, struct stats *st) { extern const char *bird_tablename; - char buf[64]; struct vrp *v; if (outputheader(out, st) < 0) @@ -61,6 +61,8 @@ output_bird1v6(FILE *out, struct vrp_tree *vrps, struct stats *st) return -1; RB_FOREACH(v, vrp_tree, vrps) { + char buf[64]; + if (v->afi == AFI_IPV6) { ip_addr_print(&v->addr, v->afi, buf, sizeof(buf)); if (fprintf(out, "\troa %s max %u as %u;\n", buf, @@ -78,7 +80,6 @@ int output_bird2(FILE *out, struct vrp_tree *vrps, struct stats *st) { extern const char *bird_tablename; - char buf[64]; struct vrp *v; time_t now = time(NULL); @@ -93,6 +94,8 @@ output_bird2(FILE *out, struct vrp_tree *vrps, struct stats *st) return -1; RB_FOREACH(v, vrp_tree, vrps) { + char buf[64]; + if (v->afi == AFI_IPV4) { ip_addr_print(&v->addr, v->afi, buf, sizeof(buf)); if (fprintf(out, "\troute %s max %u as %u;\n", buf, @@ -106,6 +109,8 @@ output_bird2(FILE *out, struct vrp_tree *vrps, struct stats *st) return -1; RB_FOREACH(v, vrp_tree, vrps) { + char buf[64]; + if (v->afi == AFI_IPV6) { ip_addr_print(&v->addr, v->afi, buf, sizeof(buf)); if (fprintf(out, "\troute %s max %u as %u;\n", buf, |