diff options
| author | Donatas Abraitis <donatas@opensourcerouting.org> | 2023-09-12 14:46:11 +0300 | 
|---|---|---|
| committer | Donatas Abraitis <donatas@opensourcerouting.org> | 2023-09-12 14:54:08 +0300 | 
| commit | 12e37cb4a0879af5c81b76d1b53f9833e0906508 (patch) | |
| tree | 01b7fe195add74f31cefe26afe6a1155016c6d16 /bgpd/bgp_attr.c | |
| parent | edd243280c56018e413a5773b2e8cb82d8be8421 (diff) | |
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 <donatas@opensourcerouting.org>
Diffstat (limited to 'bgpd/bgp_attr.c')
| -rw-r--r-- | bgpd/bgp_attr.c | 8 | 
1 files changed, 4 insertions, 4 deletions
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c index 3b22702937..3a66f74f84 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++) {  | 
