bgpd: Allow filtering PMSI Tunnel attribute

Filtering this attribute via `path-attribute discard/treat-as-widthraw`.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
Donatas Abraitis 2024-08-25 19:05:53 +03:00
parent f390253ca7
commit f0bb2626ef

View File

@ -3369,6 +3369,9 @@ bgp_attr_pmsi_tunnel(struct bgp_attr_parser_args *args)
uint8_t tnl_type;
int attr_parse_len = 2 + BGP_LABEL_BYTES;
if (peer->discard_attrs[args->type] || peer->withdraw_attrs[args->type])
goto pmsi_tunnel_ignore;
/* Verify that the receiver is expecting "ingress replication" as we
* can only support that.
*/
@ -3405,6 +3408,11 @@ bgp_attr_pmsi_tunnel(struct bgp_attr_parser_args *args)
stream_forward_getp(peer->curr, length - attr_parse_len);
return BGP_ATTR_PARSE_PROCEED;
pmsi_tunnel_ignore:
stream_forward_getp(peer->curr, length);
return bgp_attr_ignore(peer, args->type);
}
/* AIGP attribute (rfc7311) */