summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_zebra.c
diff options
context:
space:
mode:
authorChirag Shah <chirag@cumulusnetworks.com>2018-02-27 11:24:16 -0800
committerChirag Shah <chirag@cumulusnetworks.com>2018-03-01 14:19:15 -0800
commit78c6ba61db8a84d1d262a9896e81bea97976753c (patch)
tree607d9fa931ef2de7d3653cc4c27399f4d157f485 /ospf6d/ospf6_zebra.c
parentc98f4d81aa5d4113ceea58ce6db4bebab5c99735 (diff)
ospf6d: assign zebra router-id to ospf6 instance
Store zebra router-id in global structure. Before router ospf6 instance created, zebra router-id callback called. During ospf6 main execution zebra init happens, but default instance does not execute until cli replay 'router ospf6'. Call ospf6_router_id_change during 'router ospf6' to assign zebra router id to ospf6 instance. Ticket:CM-19937 Testing Done: Assign Loopback /32 (6.6.6.6/32) address, restart frr with (router ospf6 in frr.conf). ospf6 default instance assigned 6.6.6.6 router-id. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Diffstat (limited to 'ospf6d/ospf6_zebra.c')
-rw-r--r--ospf6d/ospf6_zebra.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c
index 4fb959b952..0decc09a29 100644
--- a/ospf6d/ospf6_zebra.c
+++ b/ospf6d/ospf6_zebra.c
@@ -55,13 +55,22 @@ static int ospf6_router_id_update_zebra(int command, struct zclient *zclient,
zebra_router_id_update_read(zclient->ibuf, &router_id);
+ om6->zebra_router_id = router_id.u.prefix4.s_addr;
+
if (o == NULL)
return 0;
o->router_id_zebra = router_id.u.prefix4;
+ if (IS_OSPF6_DEBUG_ZEBRA(RECV)) {
+ char buf[INET_ADDRSTRLEN];
+
+ zlog_debug("%s: zebra router-id %s update",
+ __PRETTY_FUNCTION__,
+ inet_ntop(AF_INET, &router_id.u.prefix4,
+ buf, INET_ADDRSTRLEN));
+ }
- if (o->router_id == 0)
- o->router_id = (uint32_t)o->router_id_zebra.s_addr;
+ ospf6_router_id_update();
return 0;
}