Skip to content

Commit

Permalink
[FRR]: Bring PR FRRouting/frr#16151 from FRR mainline
Browse files Browse the repository at this point in the history
This commit brings PR FRRouting/frr#16151 from FRR mainline to SONiC

zebra: display srv6 encapsulation source-address when configured
FRRouting/frr#16151

Signed-off-by: cscarpitta <cscarpit@cisco.com>
  • Loading branch information
cscarpitta authored and VladimirKuk committed Jan 21, 2025
1 parent 4155f3f commit 9a3e78e
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
From 890b67d7a9eb6ee9cbb6b5623934ad4d0b781232 Mon Sep 17 00:00:00 2001

From: Philippe Guibert <philippe.guibert@6wind.com>

Subject: [PATCH] zebra: display srv6 encapsulation source-address when
configured

The 'show running-config' does not display the ipv6 source address
when a locator is not configured. Fix this by systematically displaying
the ipv6 source address.

Fixes: 6a0956169b31 ("zebra: Add encap source address to SRv6 config write function")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
---
zebra/zebra_srv6_vty.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/zebra/zebra_srv6_vty.c b/zebra/zebra_srv6_vty.c
index c5b850599..d5cd30e64 100644
--- a/zebra/zebra_srv6_vty.c
+++ b/zebra/zebra_srv6_vty.c
@@ -475,16 +475,24 @@ static int zebra_sr_config(struct vty *vty)
struct listnode *node;
struct srv6_locator *locator;
char str[256];
+ bool display_source_srv6 = false;
+
+ if (srv6 && !IPV6_ADDR_SAME(&srv6->encap_src_addr, &in6addr_any))
+ display_source_srv6 = true;

vty_out(vty, "!\n");
- if (zebra_srv6_is_enable()) {
+ if (display_source_srv6 || zebra_srv6_is_enable()) {
vty_out(vty, "segment-routing\n");
vty_out(vty, " srv6\n");
+ }
+ if (display_source_srv6) {
if (!IPV6_ADDR_SAME(&srv6->encap_src_addr, &in6addr_any)) {
vty_out(vty, " encapsulation\n");
vty_out(vty, " source-address %pI6\n",
&srv6->encap_src_addr);
}
+ }
+ if (zebra_srv6_is_enable()) {
vty_out(vty, " locators\n");
for (ALL_LIST_ELEMENTS_RO(srv6->locators, node, locator)) {
inet_ntop(AF_INET6, &locator->prefix.prefix,
@@ -514,6 +522,8 @@ static int zebra_sr_config(struct vty *vty)
vty_out(vty, " !\n");
vty_out(vty, " exit\n");
vty_out(vty, " !\n");
+ }
+ if (display_source_srv6 || zebra_srv6_is_enable()) {
vty_out(vty, "exit\n");
vty_out(vty, "!\n");
}
1 change: 1 addition & 0 deletions src/sonic-frr/patch/series
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@
0062-zebra-lib-use-internal-rbtree-per-ns.patch
0063-Patch-to-send-tag-value-associated-with-route-via-ne.patch
0064-SRv6-BGP-SID-reachability.patch
0065-zebra-display-srv6-encapsulation-source-address-when-configured.patch

0 comments on commit 9a3e78e

Please sign in to comment.