summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2021-06-30 11:22:08 -0300
committerGitHub <noreply@github.com>2021-06-30 11:22:08 -0300
commitc36a440cbaf056f73472e3b79dc7e8e3d957a0b9 (patch)
treeb634c25c48e5b04ea57c2dd297f93e1d65364c55
parent309f6af6054f915c061f738d7a97801e1166ea22 (diff)
parent3c5122c5a7245f703bab3aec098a0f28822eb903 (diff)
Merge pull request #8950 from idryzhov/ospf6-router-id
ospf6d: use per-vrf router id instead of one global
-rw-r--r--ospf6d/ospf6_top.c6
-rw-r--r--ospf6d/ospf6_top.h3
-rw-r--r--ospf6d/ospf6_zebra.c11
3 files changed, 10 insertions, 10 deletions
diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c
index 057f89797a..6f40989efd 100644
--- a/ospf6d/ospf6_top.c
+++ b/ospf6d/ospf6_top.c
@@ -602,7 +602,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 */
@@ -786,8 +786,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;
}
diff --git a/ospf6d/ospf6_top.h b/ospf6d/ospf6_top.h
index 51df4b6b8e..f0251bcb62 100644
--- a/ospf6d/ospf6_top.h
+++ b/ospf6d/ospf6_top.h
@@ -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 */
@@ -71,7 +70,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;
diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c
index 170d545c49..a7e15c68ae 100644
--- a/ospf6d/ospf6_zebra.c
+++ b/ospf6d/ospf6_zebra.c
@@ -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);