Skip to content

zebra: Static routes async notification do not need this test #13875

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions zebra/zebra_rib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,7 @@ static void zebra_rib_evaluate_mpls(struct route_node *rn)
*/
static bool rib_route_match_ctx(const struct route_entry *re,
const struct zebra_dplane_ctx *ctx,
bool is_update)
bool is_update, bool async)
{
bool result = false;

Expand All @@ -1454,13 +1454,12 @@ static bool rib_route_match_ctx(const struct route_entry *re,
/* We use an extra test for statics, and another for
* kernel routes.
*/
if (re->type == ZEBRA_ROUTE_STATIC &&
if (re->type == ZEBRA_ROUTE_STATIC && !async &&
(re->distance != dplane_ctx_get_old_distance(ctx) ||
re->tag != dplane_ctx_get_old_tag(ctx))) {
result = false;
} else if (re->type == ZEBRA_ROUTE_KERNEL &&
re->metric !=
dplane_ctx_get_old_metric(ctx)) {
re->metric != dplane_ctx_get_old_metric(ctx)) {
result = false;
}
}
Expand All @@ -1482,7 +1481,7 @@ static bool rib_route_match_ctx(const struct route_entry *re,
/* We use an extra test for statics, and another for
* kernel routes.
*/
if (re->type == ZEBRA_ROUTE_STATIC &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you want to remove this test for the "update" clause above?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah I should shouldn't I give me a bit

if (re->type == ZEBRA_ROUTE_STATIC && !async &&
(re->distance != dplane_ctx_get_distance(ctx) ||
re->tag != dplane_ctx_get_tag(ctx))) {
result = false;
Expand Down Expand Up @@ -1946,13 +1945,13 @@ static void rib_process_result(struct zebra_dplane_ctx *ctx)
RNODE_FOREACH_RE(rn, rib) {

if (re == NULL) {
if (rib_route_match_ctx(rib, ctx, false))
if (rib_route_match_ctx(rib, ctx, false, false))
re = rib;
}

/* Check for old route match */
if (is_update && (old_re == NULL)) {
if (rib_route_match_ctx(rib, ctx, true /*is_update*/))
if (rib_route_match_ctx(rib, ctx, true, false))
old_re = rib;
}

Expand Down Expand Up @@ -2271,7 +2270,7 @@ static void rib_process_dplane_notify(struct zebra_dplane_ctx *ctx)
* info.
*/
RNODE_FOREACH_RE(rn, re) {
if (rib_route_match_ctx(re, ctx, false /*!update*/))
if (rib_route_match_ctx(re, ctx, false, true))
break;
}

Expand Down