Skip to content

Commit 372907d

Browse files
committed
zebra: Static routes async notification do not need this test
When using asic_offload with an asynchronous notification the rib_route_match_ctx function is testing for distance and tag being correct against the re. This is no longer necessary. Normal route notification for static routes is this(well really all routes): a) zebra dplane generates a ctx to send to the dplane for route install b) dplane installs it in the kernel c) if the dplane_fpm_nl.c module is being used it installs it. d) The context's success code is set to it worked and passes the context back up to zebra for processing. e) Zebra master receives this and checks the distance and tag are correct for static routes and accepts the route and marks it installed. If the operator is using a wait for install mechansim where the dplane is asynchronously sending the result back up at a future time *and* it is using the dplane_fpm_nl.c code where it uses the rt_netlink.c route parsing code, then there is no way to set distance as that we do not pass distance to the kernel. As such static routes were never being properly handled since the re and context would not match and the route would still be marked as queued. This code is historical in nature and is no longer necessary. rib_route_match_ctx is only ever used with dplane notifications. Additionally static routes are now handled more intelligently from staticd and the distance changes are held in staticd not zebra, thus it can be removed. Signed-off-by: Donald Sharp <[email protected]>
1 parent 579d00e commit 372907d

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

zebra/zebra_rib.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,15 +1479,12 @@ static bool rib_route_match_ctx(const struct route_entry *re,
14791479
(re->instance == dplane_ctx_get_instance(ctx))) {
14801480
result = true;
14811481

1482-
/* We use an extra test for statics, and another for
1483-
* kernel routes.
1482+
/*
1483+
* We use different tests for kernel and for
1484+
* connected routes.
14841485
*/
1485-
if (re->type == ZEBRA_ROUTE_STATIC &&
1486-
(re->distance != dplane_ctx_get_distance(ctx) ||
1487-
re->tag != dplane_ctx_get_tag(ctx))) {
1488-
result = false;
1489-
} else if (re->type == ZEBRA_ROUTE_KERNEL &&
1490-
re->metric != dplane_ctx_get_metric(ctx)) {
1486+
if (re->type == ZEBRA_ROUTE_KERNEL &&
1487+
re->metric != dplane_ctx_get_metric(ctx)) {
14911488
result = false;
14921489
} else if (re->type == ZEBRA_ROUTE_CONNECT) {
14931490
result = nexthop_group_equal_no_recurse(

0 commit comments

Comments
 (0)