diff options
| author | Donatas Abraitis <donatas@opensourcerouting.org> | 2024-08-25 19:05:53 +0300 | 
|---|---|---|
| committer | Donatas Abraitis <donatas@opensourcerouting.org> | 2024-08-25 19:05:53 +0300 | 
| commit | f0bb2626ef2c847638393a366f1f894e9874d081 (patch) | |
| tree | 7a14e190f0880c67f1952d11b236358161c69a7b /bgpd/bgp_attr.c | |
| parent | f390253ca758152f2a30a6f8470edb69b209758b (diff) | |
bgpd: Allow filtering PMSI Tunnel attribute
Filtering this attribute via `path-attribute discard/treat-as-widthraw`.
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, 8 insertions, 0 deletions
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c index 9ce15d016b..cc4a0d2032 100644 --- a/bgpd/bgp_attr.c +++ b/bgpd/bgp_attr.c @@ -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) */  | 
