Skip to content

Commit d6caf0d

Browse files
authored
Merge pull request #13875 from donaldsharp/static_dplane_issues
zebra: Static routes async notification do not need this test
2 parents 9a0bb7b + d0123a9 commit d6caf0d

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

zebra/zebra_rib.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,7 +1438,7 @@ static void zebra_rib_evaluate_mpls(struct route_node *rn)
14381438
*/
14391439
static bool rib_route_match_ctx(const struct route_entry *re,
14401440
const struct zebra_dplane_ctx *ctx,
1441-
bool is_update)
1441+
bool is_update, bool async)
14421442
{
14431443
bool result = false;
14441444

@@ -1454,13 +1454,12 @@ static bool rib_route_match_ctx(const struct route_entry *re,
14541454
/* We use an extra test for statics, and another for
14551455
* kernel routes.
14561456
*/
1457-
if (re->type == ZEBRA_ROUTE_STATIC &&
1457+
if (re->type == ZEBRA_ROUTE_STATIC && !async &&
14581458
(re->distance != dplane_ctx_get_old_distance(ctx) ||
14591459
re->tag != dplane_ctx_get_old_tag(ctx))) {
14601460
result = false;
14611461
} else if (re->type == ZEBRA_ROUTE_KERNEL &&
1462-
re->metric !=
1463-
dplane_ctx_get_old_metric(ctx)) {
1462+
re->metric != dplane_ctx_get_old_metric(ctx)) {
14641463
result = false;
14651464
}
14661465
}
@@ -1482,7 +1481,7 @@ static bool rib_route_match_ctx(const struct route_entry *re,
14821481
/* We use an extra test for statics, and another for
14831482
* kernel routes.
14841483
*/
1485-
if (re->type == ZEBRA_ROUTE_STATIC &&
1484+
if (re->type == ZEBRA_ROUTE_STATIC && !async &&
14861485
(re->distance != dplane_ctx_get_distance(ctx) ||
14871486
re->tag != dplane_ctx_get_tag(ctx))) {
14881487
result = false;
@@ -1946,13 +1945,13 @@ static void rib_process_result(struct zebra_dplane_ctx *ctx)
19461945
RNODE_FOREACH_RE(rn, rib) {
19471946

19481947
if (re == NULL) {
1949-
if (rib_route_match_ctx(rib, ctx, false))
1948+
if (rib_route_match_ctx(rib, ctx, false, false))
19501949
re = rib;
19511950
}
19521951

19531952
/* Check for old route match */
19541953
if (is_update && (old_re == NULL)) {
1955-
if (rib_route_match_ctx(rib, ctx, true /*is_update*/))
1954+
if (rib_route_match_ctx(rib, ctx, true, false))
19561955
old_re = rib;
19571956
}
19581957

@@ -2271,7 +2270,7 @@ static void rib_process_dplane_notify(struct zebra_dplane_ctx *ctx)
22712270
* info.
22722271
*/
22732272
RNODE_FOREACH_RE(rn, re) {
2274-
if (rib_route_match_ctx(re, ctx, false /*!update*/))
2273+
if (rib_route_match_ctx(re, ctx, false, true))
22752274
break;
22762275
}
22772276

0 commit comments

Comments
 (0)