summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_route.c
diff options
context:
space:
mode:
authorMark Stapp <mstapp@nvidia.com>2021-11-02 20:45:58 +0100
committerMark Stapp <mstapp@nvidia.com>2021-12-01 13:56:38 +0100
commit907707db480a47b6ba447af0551303c4c6be1098 (patch)
treea41df2ec0ca5f0cfa4edceabd00b6e97e6403180 /bgpd/bgp_route.c
parentMerge pull request #9878 from pguibert6WIND/resolver_vrf (diff)
downloadfrr-907707db480a47b6ba447af0551303c4c6be1098.tar.xz
frr-907707db480a47b6ba447af0551303c4c6be1098.zip
bgpd: clearer safi handling for BGP-LU route updates
Don't hide the LABELED_UNICAST safi when processing route updates; map it where necessary (to use the UNICAST table for instance). Signed-off-by: Mark Stapp <mstapp@nvidia.com>
Diffstat (limited to 'bgpd/bgp_route.c')
-rw-r--r--bgpd/bgp_route.c9
1 files changed, 7 insertions, 2 deletions
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++;