Skip to content

Commit

Permalink
bgpd: remove label arguments from bgp_input_modifier
Browse files Browse the repository at this point in the history
Remove label arguments from bgp_input_modifier. It is already set in
attr.

Signed-off-by: Louis Scalbert <[email protected]>
  • Loading branch information
louis-6wind committed Jan 30, 2024
1 parent 7e730ea commit 5a31395
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -1747,8 +1747,8 @@ static bool bgp_check_role_applicability(afi_t afi, safi_t safi)

static int bgp_input_modifier(struct peer *peer, const struct prefix *p,
struct attr *attr, afi_t afi, safi_t safi,
const char *rmap_name, mpls_label_t *label,
uint32_t num_labels, struct bgp_dest *dest)
const char *rmap_name,
struct bgp_dest *dest)
{
struct bgp_filter *filter;
struct bgp_path_info rmap_path = { 0 };
Expand Down Expand Up @@ -1785,11 +1785,6 @@ static int bgp_input_modifier(struct peer *peer, const struct prefix *p,
rmap_path.extra = &extra;
rmap_path.net = dest;

rmap_path.attr->num_labels = num_labels;
if (label && num_labels && num_labels <= BGP_MAX_LABELS)
memcpy(&rmap_path.attr->label_tbl, label,
num_labels * sizeof(mpls_label_t));

SET_FLAG(peer->rmap_type, PEER_RMAP_TYPE_IN);

/* Apply BGP route map to the attribute. */
Expand Down Expand Up @@ -3786,7 +3781,7 @@ static uint32_t bgp_filtered_routes_count(struct peer *peer, afi_t afi,
if (bgp_input_modifier(
peer, rn_p, &attr, afi, safi,
ROUTE_MAP_IN_NAME(&peer->filter[afi][safi]),
NULL, 0, NULL)
NULL)
== RMAP_DENY)
filtered = true;

Expand Down Expand Up @@ -4402,8 +4397,8 @@ void 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, orig_safi, NULL, attr->label_tbl,
attr->num_labels, dest)
if (bgp_input_modifier(peer, p, &new_attr, afi, orig_safi, NULL,
dest)
== RMAP_DENY) {
peer->stat_pfx_filter++;
reason = "route-map;";
Expand Down Expand Up @@ -14161,8 +14156,8 @@ show_adj_route(struct vty *vty, struct peer *peer, struct bgp_table *table,

/* Filter prefix using route-map */
ret = bgp_input_modifier(peer, rn_p, &attr, afi,
safi, rmap_name, NULL,
0, NULL);
safi, rmap_name,
NULL);

if (type == bgp_show_adj_route_filtered &&
!route_filtered && ret != RMAP_DENY) {
Expand Down

0 comments on commit 5a31395

Please sign in to comment.