From 6a0956169b317b707670c6285ece50ee4a95d198 Mon Sep 17 00:00:00 2001 From: Carmine Scarpitta Date: Mon, 5 Sep 2022 19:23:54 +0200 Subject: [PATCH] zebra: Add encap source address to SRv6 config write function When writing the SRv6 config from zebra, we must also include the source address of outer encapsulating IPv6 header. Signed-off-by: Carmine Scarpitta --- zebra/zebra_srv6_vty.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zebra/zebra_srv6_vty.c b/zebra/zebra_srv6_vty.c index 417489fbcf..c5b8505992 100644 --- a/zebra/zebra_srv6_vty.c +++ b/zebra/zebra_srv6_vty.c @@ -480,6 +480,11 @@ static int zebra_sr_config(struct vty *vty) if (zebra_srv6_is_enable()) { vty_out(vty, "segment-routing\n"); vty_out(vty, " srv6\n"); + 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); + } vty_out(vty, " locators\n"); for (ALL_LIST_ELEMENTS_RO(srv6->locators, node, locator)) { inet_ntop(AF_INET6, &locator->prefix.prefix, -- 2.39.5