diff options
Diffstat (limited to 'bgpd/bgpd.c')
| -rw-r--r-- | bgpd/bgpd.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 39010e76f9..f4e823e212 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -4213,6 +4213,26 @@ bool bgp_path_attribute_discard(struct peer *peer, char *buf, size_t size) return false; } +bool bgp_path_attribute_treat_as_withdraw(struct peer *peer, char *buf, + size_t size) +{ + if (!buf) + return false; + + buf[0] = '\0'; + + for (unsigned int i = 0; i < BGP_ATTR_MAX; i++) { + if (peer->withdraw_attrs[i]) + snprintf(buf + strlen(buf), size - strlen(buf), "%s%d", + (strlen(buf) > 0) ? " " : "", i); + } + + if (strlen(buf) > 0) + return true; + + return false; +} + /* If peer is configured at least one address family return 1. */ bool peer_active(struct peer *peer) { |
