From 12e37cb4a0879af5c81b76d1b53f9833e0906508 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Tue, 12 Sep 2023 14:46:11 +0300 Subject: bgpd: BGP_ATTR_MAX can be 255, allow using it for path attr discard/withdraw cmds https://www.rfc-editor.org/rfc/rfc2042.html says: 255 reserved for development In FRR, 255 is kinda used too BGP_ATTR_VNC, even more we allow setting 255 in CLI. Signed-off-by: Donatas Abraitis --- bgpd/bgp_attr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bgpd/bgp_attr.c') diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c index 3b2270293..3a66f74f8 100644 --- a/bgpd/bgp_attr.c +++ b/bgpd/bgp_attr.c @@ -5145,7 +5145,7 @@ void bgp_path_attribute_discard_vty(struct vty *vty, struct peer *peer, * then flush all. */ if (!discard_attrs) { - for (i = 0; i < BGP_ATTR_MAX; i++) + for (i = 1; i <= BGP_ATTR_MAX; i++) peer->discard_attrs[i] = false; goto discard_soft_clear; } @@ -5154,7 +5154,7 @@ void bgp_path_attribute_discard_vty(struct vty *vty, struct peer *peer, frrstr_split(discard_attrs, " ", &attributes, &num_attributes); if (set) - for (i = 0; i < BGP_ATTR_MAX; i++) + for (i = 1; i <= BGP_ATTR_MAX; i++) peer->discard_attrs[i] = false; for (i = 0; i < num_attributes; i++) { @@ -5214,7 +5214,7 @@ void bgp_path_attribute_withdraw_vty(struct vty *vty, struct peer *peer, * then flush all. */ if (!withdraw_attrs) { - for (i = 0; i < BGP_ATTR_MAX; i++) + for (i = 1; i <= BGP_ATTR_MAX; i++) peer->withdraw_attrs[i] = false; goto withdraw_soft_clear; } @@ -5223,7 +5223,7 @@ void bgp_path_attribute_withdraw_vty(struct vty *vty, struct peer *peer, frrstr_split(withdraw_attrs, " ", &attributes, &num_attributes); if (set) - for (i = 0; i < BGP_ATTR_MAX; i++) + for (i = 1; i <= BGP_ATTR_MAX; i++) peer->withdraw_attrs[i] = false; for (i = 0; i < num_attributes; i++) { -- cgit v1.2.3