Skip to content

Commit

Permalink
[FRR Patch] Added patch in FRR to send tag value associated with rout…
Browse files Browse the repository at this point in the history
…e via Netlink to fpmsyncd (#20692)

* Added patch in FRR to send tag value associated with route
via NETLINK RTA_PRIORITY field which can be used as attribute/metadata
in fpmsyncd for different use-cases.

---------

Signed-off-by: Abhishek Dosi <[email protected]>
  • Loading branch information
abdosi authored Dec 12, 2024
1 parent ade34bf commit 5b6ff85
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
From c0418c02dabe901f5dc39c85ce2e80bd361d7c78 Mon Sep 17 00:00:00 2001
From: Abhishek Dosi <[email protected]>
Date: Wed, 11 Dec 2024 11:19:05 +0000
Subject: [PATCH] Patch to send tag value associated with route via netlink in
RTA_PRIORITY field.

Signed-off-by: Abhishek Dosi <[email protected]>
---
zebra/rt_netlink.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 976c245c3..1f73f5759 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -2348,10 +2348,28 @@ ssize_t netlink_route_multipath_msg_encode(int cmd, struct zebra_dplane_ctx *ctx
* path(s)
* by the routing protocol and for communicating with protocol peers.
*/
- if (!nl_attr_put32(&req->n, datalen, RTA_PRIORITY,
- ROUTE_INSTALLATION_METRIC))
+ if (fpm)
+ {
+ /* Patch to send tag value as route attribute using RTA_PRIORITY
+ * which can be used as metadata/attribute to take application specific
+ * action. As seen in above comment this field is not use anyways and can be
+ * use by fpmsyncd */
+ if (!nl_attr_put32(&req->n, datalen, RTA_PRIORITY,
+ cmd == RTM_DELROUTE ? dplane_ctx_get_old_tag(ctx) :
+ dplane_ctx_get_tag(ctx)))
+ {
return 0;

+ }
+ }
+ else
+ {
+ if (!nl_attr_put32(&req->n, datalen, RTA_PRIORITY,
+ ROUTE_INSTALLATION_METRIC))
+ {
+ return 0;
+ }
+ }
#if defined(SUPPORT_REALMS)
if (cmd == RTM_DELROUTE)
tag = dplane_ctx_get_old_tag(ctx);
--
2.25.1

1 change: 1 addition & 0 deletions src/sonic-frr/patch/series
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@
0060-bgpd-Validate-both-nexthop-information-NEXTHOP-and-N.patch
0061-Set-multipath-to-514-and-disable-bgp-vnc-for-optimiz.patch
0062-zebra-lib-use-internal-rbtree-per-ns.patch
0063-Patch-to-send-tag-value-associated-with-route-via-ne.patch

0 comments on commit 5b6ff85

Please sign in to comment.