diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2020-05-02 14:31:33 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2020-05-02 14:31:33 +0000 |
commit | 29e5a10faeed6b5a9131380023dc689c65f829bf (patch) | |
tree | f8e615151c9315b6c58ec6cefc271781257d0a79 | |
parent | 3caf178da845bbc92ee82b749a9b6d979f9efa4a (diff) |
Adjust fmt_attr() to pass in -1 for flags to tell it you don't care
about the flags of the attribute. Part of the JSON output diff.
OK job@, benno@, deraadt@
-rw-r--r-- | usr.sbin/bgpctl/bgpctl.c | 6 | ||||
-rw-r--r-- | usr.sbin/bgpctl/bgpctl.h | 3 |
2 files changed, 4 insertions, 5 deletions
diff --git a/usr.sbin/bgpctl/bgpctl.c b/usr.sbin/bgpctl/bgpctl.c index c4a877f4909..434750c4100 100644 --- a/usr.sbin/bgpctl/bgpctl.c +++ b/usr.sbin/bgpctl/bgpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpctl.c,v 1.260 2020/05/02 14:28:10 claudio Exp $ */ +/* $OpenBSD: bgpctl.c,v 1.261 2020/05/02 14:31:32 claudio Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -766,7 +766,7 @@ fmt_errstr(u_int8_t errcode, u_int8_t subcode) } const char * -fmt_attr(u_int8_t type, u_int8_t flags) +fmt_attr(u_int8_t type, int flags) { #define CHECK_FLAGS(s, t, m) \ if (((s) & ~(ATTR_DEFMASK | (m))) != (t)) pflags = 1 @@ -845,7 +845,7 @@ fmt_attr(u_int8_t type, u_int8_t flags) pflags = 1; break; } - if (pflags) { + if (flags != -1 && pflags) { strlcat(cstr, " flags [", sizeof(cstr)); if (flags & ATTR_OPTIONAL) strlcat(cstr, "O", sizeof(cstr)); diff --git a/usr.sbin/bgpctl/bgpctl.h b/usr.sbin/bgpctl/bgpctl.h index f829bf9e6ba..922ab9c15ca 100644 --- a/usr.sbin/bgpctl/bgpctl.h +++ b/usr.sbin/bgpctl/bgpctl.h @@ -49,8 +49,7 @@ const char *fmt_ovs(u_int8_t, int); const char *fmt_auth_method(enum auth_method); const char *fmt_mem(long long); const char *fmt_errstr(u_int8_t, u_int8_t); -const char *fmt_attr(u_int8_t, u_int8_t); +const char *fmt_attr(u_int8_t, int); const char *fmt_community(u_int16_t, u_int16_t); const char *fmt_large_community(u_int32_t, u_int32_t, u_int32_t); const char *fmt_ext_community(u_int8_t *); - |