]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospf6d: use per-vrf router id instead of one global 9140/head
authorIgor Ryzhov <iryzhov@nfware.com>
Tue, 29 Jun 2021 15:10:41 +0000 (18:10 +0300)
committermergify-bot <noreply@mergify.io>
Fri, 23 Jul 2021 09:13:24 +0000 (09:13 +0000)
This code was not fully completed when adding support for VRFs.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
(cherry picked from commit 3c5122c5a7245f703bab3aec098a0f28822eb903)

ospf6d/ospf6_top.c
ospf6d/ospf6_top.h
ospf6d/ospf6_zebra.c

index c312b5d2ffc086595d6292eb8e40850465f0fe7c..cd2413722d32a22d01d5337f8c21c08d39a22c45 100644 (file)
@@ -563,7 +563,7 @@ void ospf6_router_id_update(struct ospf6 *ospf6)
        if (ospf6->router_id_static != 0)
                ospf6->router_id = ospf6->router_id_static;
        else
-               ospf6->router_id = om6->zebra_router_id;
+               ospf6->router_id = ospf6->router_id_zebra;
 }
 
 /* start ospf6 */
@@ -675,8 +675,8 @@ DEFUN(no_ospf6_router_id,
                }
        }
        o->router_id = 0;
-       if (o->router_id_zebra.s_addr)
-               o->router_id = (uint32_t)o->router_id_zebra.s_addr;
+       if (o->router_id_zebra)
+               o->router_id = o->router_id_zebra;
 
        return CMD_SUCCESS;
 }
index e99ac1c38765c4eebac9aad1d4f86b11234ffd14..d298fecb86ce58305c0473ef119094afb0817c77 100644 (file)
@@ -29,7 +29,6 @@ struct ospf6_master {
        struct list *ospf6;
        /* OSPFv3 thread master. */
        struct thread_master *master;
-       in_addr_t zebra_router_id;
 };
 
 /* ospf6->config_flags */
@@ -74,7 +73,7 @@ struct ospf6 {
        /* static router id */
        in_addr_t router_id_static;
 
-       struct in_addr router_id_zebra;
+       in_addr_t router_id_zebra;
 
        /* start time */
        struct timeval starttime;
index 170d545c49cdd0c909bbb27f14cb1af5fc711b28..a7e15c68ae81f35b6fba3a446de1acdd38804d2a 100644 (file)
@@ -90,15 +90,16 @@ static int ospf6_router_id_update_zebra(ZAPI_CALLBACK_ARGS)
 
        zebra_router_id_update_read(zclient->ibuf, &router_id);
 
-       om6->zebra_router_id = router_id.u.prefix4.s_addr;
+       if (IS_OSPF6_DEBUG_ZEBRA(RECV))
+               zlog_debug("Zebra router-id update %pI4 vrf %s id %u",
+                          &router_id.u.prefix4, ospf6_vrf_id_to_name(vrf_id),
+                          vrf_id);
+
        o = ospf6_lookup_by_vrf_id(vrf_id);
        if (o == NULL)
                return 0;
 
-       o->router_id_zebra = router_id.u.prefix4;
-       if (IS_OSPF6_DEBUG_ZEBRA(RECV))
-               zlog_debug("%s: zebra router-id %pI4 update", __func__,
-                          &router_id.u.prefix4);
+       o->router_id_zebra = router_id.u.prefix4.s_addr;
 
        ospf6_router_id_update(o);