Skip to content

Commit

Permalink
Updated the patch to have fpm flag check
Browse files Browse the repository at this point in the history
Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
  • Loading branch information
abdosi committed Nov 27, 2024
1 parent 2821e45 commit 9487b1f
Showing 1 changed file with 28 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,37 +1,49 @@
From 1a8b3715a88aeaa4bda1ac445aa4992a14f33f31 Mon Sep 17 00:00:00 2001
From dd71a11ab9543622553a3835dac6513faa27b990 Mon Sep 17 00:00:00 2001
From: Abhishek Dosi <abdosi@microsoft.com>
Date: Fri, 8 Nov 2024 02:19:37 +0000
Subject: [PATCH] Patch to send tag value associated with route via netlink in
Date: Wed, 27 Nov 2024 02:45:50 +0000
Subject: [PATCH] Patch to send tag value associated with route via netlink in
RTA_PRIORITY field.

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
---
zebra/rt_netlink.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
zebra/rt_netlink.c | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 3f51894be..65f598aad 100644
index 3f51894be..33818c99b 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -2113,9 +2113,17 @@ ssize_t netlink_route_multipath_msg_encode(int cmd,
@@ -2113,10 +2113,27 @@ ssize_t netlink_route_multipath_msg_encode(int cmd,
* path(s)
* by the routing protocol and for communicating with protocol peers.
*/
+
+ /* 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,
- if (!nl_attr_put32(&req->n, datalen, RTA_PRIORITY,
- ROUTE_INSTALLATION_METRIC))
+ cmd == RTM_DELROUTE ? dplane_ctx_get_old_tag(ctx) :
+ dplane_ctx_get_tag(ctx)))
+ 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

0 comments on commit 9487b1f

Please sign in to comment.