From 18a6dce6f83dd20caf1f36c8e840868ff0bf6dbd Mon Sep 17 00:00:00 2001 From: hasso Date: Sun, 3 Oct 2004 18:18:34 +0000 Subject: Common router id. --- ospf6d/ChangeLog | 5 +++++ ospf6d/ospf6_zebra.c | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+) (limited to 'ospf6d') diff --git a/ospf6d/ChangeLog b/ospf6d/ChangeLog index a37c4ac1..7778c58a 100644 --- a/ospf6d/ChangeLog +++ b/ospf6d/ChangeLog @@ -1,3 +1,8 @@ +2004-10-03 Hasso Tepper + + * ospf6_zebra.c: Use router id from zebra daemon if it wasn't set in + configuration. + 2004-09-25 Hasso Tepper * ospf6_asbr.c, ospf6_lsa.c, ospf6_proto.c, ospf6_proto.h: Fix diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c index dd89d8db..0baaaea9 100644 --- a/ospf6d/ospf6_zebra.c +++ b/ospf6d/ospf6_zebra.c @@ -44,6 +44,25 @@ unsigned char conf_debug_ospf6_zebra = 0; /* information about zebra. */ struct zclient *zclient = NULL; +struct in_addr router_id_zebra; + +/* Router-id update message from zebra. */ +int +ospf6_router_id_update_zebra (int command, struct zclient *zclient, + zebra_size_t length) +{ + struct prefix router_id; + struct ospf6 *o = ospf6; + + zebra_router_id_update_read(zclient->ibuf,&router_id); + router_id_zebra = router_id.u.prefix4; + + if (o->router_id == 0) + o->router_id = (u_int32_t) router_id_zebra.s_addr; + + return 0; +} + /* redistribute function */ void ospf6_zebra_redistribute (int type) @@ -535,6 +554,7 @@ ospf6_zebra_init () /* Allocate zebra structure. */ zclient = zclient_new (); zclient_init (zclient, ZEBRA_ROUTE_OSPF6); + zclient->router_id_update = ospf6_router_id_update_zebra; zclient->interface_add = ospf6_zebra_if_add; zclient->interface_delete = ospf6_zebra_if_del; zclient->interface_up = ospf6_zebra_if_state_update; -- cgit v1.2.1