Skip to content

Commit

Permalink
[FRR]Fixing the advertisement of static ipv6 route (sonic-net#15688)
Browse files Browse the repository at this point in the history
Co-authored-by: dgsudharsan <[email protected]>
Co-authored-by: Liat Grozovik <[email protected]>
  • Loading branch information
3 people authored Jul 6, 2023
1 parent e46be54 commit 6f6218a
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
From cb89515f7751c23368bc8dcaf0bcf768a42a0c11 Mon Sep 17 00:00:00 2001
From: dgsudharsan <[email protected]>
Date: Wed, 28 Jun 2023 19:42:16 +0000
Subject: [PATCH] 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.

diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index a8dbe4470..e021ed142 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -1385,15 +1385,12 @@ static bool rib_route_match_ctx(const struct route_entry *re,
(re->instance == dplane_ctx_get_instance(ctx))) {
result = true;

- /* We use an extra test for statics, and another for
- * kernel routes.
+ /*
+ * We use different tests for kernel and for
+ * connected routes.
*/
- if (re->type == ZEBRA_ROUTE_STATIC &&
- (re->distance != dplane_ctx_get_distance(ctx) ||
- re->tag != dplane_ctx_get_tag(ctx))) {
- result = false;
- } else if (re->type == ZEBRA_ROUTE_KERNEL &&
- re->metric != dplane_ctx_get_metric(ctx)) {
+ if (re->type == ZEBRA_ROUTE_KERNEL &&
+ re->metric != dplane_ctx_get_metric(ctx)) {
result = false;
} else if (re->type == ZEBRA_ROUTE_CONNECT) {
result = nexthop_group_equal_no_recurse(
--
2.17.1

2 changes: 1 addition & 1 deletion src/sonic-frr/patch/series
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ cross-compile-changes.patch
0027-bgpd-Ensure-FRR-has-enough-data-to-read-in-peek_for_as4_capability-and-bgp_open_option_parse.patch
0028-bgpd-Ensure-that-bgp-open-message-stream-has-enough-data-to-read.patch
0029-bgpd-Change-log-level-for-graceful-restart-events.patch

0030-zebra-Static-routes-async-notification-do-not-need-t.patch

0 comments on commit 6f6218a

Please sign in to comment.