summaryrefslogtreecommitdiff
path: root/bgpd
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2025-02-03 14:49:53 +0100
committerDonatas Abraitis <donatas@opensourcerouting.org>2025-02-04 23:37:31 +0200
commit9075eaa07f523a753a061c7d94c401c6ba089d14 (patch)
treea4e19f28437023e606f351cf4af9e54354b2e259 /bgpd
parentb17fd55d831a9c02010b04bd74b475726936d9b8 (diff)
bgpd: fix add label support to EVPN AD routes
When peering with an EVPN device from other vendor, FRR acting as route reflector is not able to read nor transmit the label value. Actually, EVPN AD routes completely ignore the label value in the code, whereas in some functionalities like evpn-vpws, it is authorised to carry and propagate label value. Fix this by handling the label value. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_evpn_mh.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/bgpd/bgp_evpn_mh.c b/bgpd/bgp_evpn_mh.c
index aa28b6f3d8..375687fe0f 100644
--- a/bgpd/bgp_evpn_mh.c
+++ b/bgpd/bgp_evpn_mh.c
@@ -1202,6 +1202,7 @@ int bgp_evpn_type1_route_process(struct peer *peer, afi_t afi, safi_t safi,
mpls_label_t label;
struct in_addr vtep_ip;
struct prefix_evpn p;
+ uint8_t num_labels = 0;
if (psize != BGP_EVPN_TYPE1_PSIZE) {
flog_err(EC_BGP_EVPN_ROUTE_INVALID,
@@ -1226,6 +1227,7 @@ int bgp_evpn_type1_route_process(struct peer *peer, afi_t afi, safi_t safi,
pfx += EVPN_ETH_TAG_BYTES;
memcpy(&label, pfx, BGP_LABEL_BYTES);
+ num_labels++;
/* EAD route prefix doesn't include the nexthop in the global
* table
@@ -1234,13 +1236,11 @@ int bgp_evpn_type1_route_process(struct peer *peer, afi_t afi, safi_t safi,
build_evpn_type1_prefix(&p, eth_tag, &esi, vtep_ip);
/* Process the route. */
if (attr) {
- bgp_update(peer, (struct prefix *)&p, addpath_id, attr, afi,
- safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd, NULL,
- 0, 0, NULL);
+ bgp_update(peer, (struct prefix *)&p, addpath_id, attr, afi, safi, ZEBRA_ROUTE_BGP,
+ BGP_ROUTE_NORMAL, &prd, &label, num_labels, 0, NULL);
} else {
- bgp_withdraw(peer, (struct prefix *)&p, addpath_id, afi, safi,
- ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, &prd, NULL, 0,
- NULL);
+ bgp_withdraw(peer, (struct prefix *)&p, addpath_id, afi, safi, ZEBRA_ROUTE_BGP,
+ BGP_ROUTE_NORMAL, &prd, &label, num_labels, NULL);
}
return 0;
}