]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: fix add label support to EVPN AD routes 18007/head
authorPhilippe Guibert <philippe.guibert@6wind.com>
Mon, 3 Feb 2025 13:49:53 +0000 (14:49 +0100)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Tue, 4 Feb 2025 16:40:03 +0000 (16:40 +0000)
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>
(cherry picked from commit 1cefe94dd3991e7e606df8da6b59707295218e55)

bgpd/bgp_evpn_mh.c

index ad3625242ee136dab259d694add6aae4f9f791c6..8acf4ea67634f04c6b8301c382730b7986978767 100644 (file)
@@ -1201,6 +1201,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,
@@ -1225,6 +1226,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
@@ -1233,12 +1235,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);
+               bgp_withdraw(peer, (struct prefix *)&p, addpath_id, afi, safi, ZEBRA_ROUTE_BGP,
+                            BGP_ROUTE_NORMAL, &prd, &label, num_labels);
        }
        return 0;
 }