summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_label.c4
-rw-r--r--bgpd/bgp_route.c9
2 files changed, 9 insertions, 4 deletions
diff --git a/bgpd/bgp_label.c b/bgpd/bgp_label.c
index fa2a44516..c101cf917 100644
--- a/bgpd/bgp_label.c
+++ b/bgpd/bgp_label.c
@@ -444,8 +444,8 @@ int bgp_nlri_parse_label(struct peer *peer, struct attr *attr,
if (attr) {
bgp_update(peer, &p, addpath_id, attr, packet->afi,
- SAFI_UNICAST, ZEBRA_ROUTE_BGP,
- BGP_ROUTE_NORMAL, NULL, &label, 1, 0, NULL);
+ safi, ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL,
+ NULL, &label, 1, 0, NULL);
} else {
bgp_withdraw(peer, &p, addpath_id, attr, packet->afi,
SAFI_UNICAST, ZEBRA_ROUTE_BGP,
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 8d0bbf75c..cd9893fd9 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -3660,6 +3660,7 @@ int bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
uint8_t pi_type = 0;
uint8_t pi_sub_type = 0;
bool force_evpn_import = false;
+ safi_t orig_safi = safi;
if (frrtrace_enabled(frr_bgp, process_update)) {
char pfxprint[PREFIX2STR_BUFFER];
@@ -3674,6 +3675,10 @@ int bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
#endif
int same_attr = 0;
+ /* Special case for BGP-LU - map LU safi to ordinary unicast safi */
+ if (orig_safi == SAFI_LABELED_UNICAST)
+ safi = SAFI_UNICAST;
+
memset(&new_attr, 0, sizeof(struct attr));
new_attr.label_index = BGP_INVALID_LABEL_INDEX;
new_attr.label = MPLS_INVALID_LABEL;
@@ -3761,7 +3766,7 @@ int bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
}
/* Apply incoming filter. */
- if (bgp_input_filter(peer, p, attr, afi, safi) == FILTER_DENY) {
+ if (bgp_input_filter(peer, p, attr, afi, orig_safi) == FILTER_DENY) {
peer->stat_pfx_filter++;
reason = "filter;";
goto filtered;
@@ -3804,7 +3809,7 @@ int bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
* commands, so we need bgp_attr_flush in the error paths, until we
* intern
* the attr (which takes over the memory references) */
- if (bgp_input_modifier(peer, p, &new_attr, afi, safi, NULL, label,
+ if (bgp_input_modifier(peer, p, &new_attr, afi, orig_safi, NULL, label,
num_labels, dest)
== RMAP_DENY) {
peer->stat_pfx_filter++;