]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Add encap source address to SRv6 config write function
authorCarmine Scarpitta <carmine.scarpitta@uniroma2.it>
Mon, 5 Sep 2022 17:23:54 +0000 (19:23 +0200)
committerCarmine Scarpitta <cscarpit@cisco.com>
Thu, 14 Dec 2023 13:58:35 +0000 (14:58 +0100)
When writing the SRv6 config from zebra, we must also include the source
address of outer encapsulating IPv6 header.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
zebra/zebra_srv6_vty.c

index 417489fbcf50159b71b30e62d5d0ac5028cbdb14..c5b8505992d69170e572d27707cab7fc2603cd69 100644 (file)
@@ -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,