summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2025-02-07 15:40:29 +0100
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2025-02-12 14:37:58 +0000
commit7a9abe777b743d3c2dce57f48e7cbeb223c319d5 (patch)
tree376636d97f6e729327ddf000d49ea0058a9e1ceb
parente9e72912a4c3e80c0c5ff89c21cb17e31363c904 (diff)
bgpd: simplify bgp_evpn_process_rt1 with label
Remove the num_labels variable, the received bgp_update() and bgp_withdraw() function will read the message as including one label or vni value. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> (cherry picked from commit 82d28f137aed2e60380807a302e2b312408eff6e)
-rw-r--r--bgpd/bgp_evpn_mh.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/bgpd/bgp_evpn_mh.c b/bgpd/bgp_evpn_mh.c
index 8acf4ea676..7fd4bb91e2 100644
--- a/bgpd/bgp_evpn_mh.c
+++ b/bgpd/bgp_evpn_mh.c
@@ -1201,7 +1201,6 @@ 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,7 +1225,6 @@ 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
@@ -1236,10 +1234,10 @@ int bgp_evpn_type1_route_process(struct peer *peer, afi_t afi, safi_t safi,
/* Process the route. */
if (attr) {
bgp_update(peer, (struct prefix *)&p, addpath_id, attr, afi, safi, ZEBRA_ROUTE_BGP,
- BGP_ROUTE_NORMAL, &prd, &label, num_labels, 0, NULL);
+ BGP_ROUTE_NORMAL, &prd, &label, 1, 0, NULL);
} else {
bgp_withdraw(peer, (struct prefix *)&p, addpath_id, afi, safi, ZEBRA_ROUTE_BGP,
- BGP_ROUTE_NORMAL, &prd, &label, num_labels);
+ BGP_ROUTE_NORMAL, &prd, &label, 1);
}
return 0;
}