/* Time stamps. */
struct timeval ts_spf; /* SPF calculation time stamp. */
+
+ uint32_t full_nbrs; /* Fully adjacent neighbors. */
};
#define OSPF6_AREA_ENABLE 0x01
if (prev_state == OSPF6_NEIGHBOR_LOADING &&
next_state == OSPF6_NEIGHBOR_FULL) {
OSPF6_AS_EXTERN_LSA_SCHEDULE(on->ospf6_if);
+ on->ospf6_if->area->full_nbrs++;
}
+
+ if (prev_state == OSPF6_NEIGHBOR_FULL)
+ on->ospf6_if->area->full_nbrs--;
}
if ((prev_state == OSPF6_NEIGHBOR_EXCHANGE
int ret;
const char *router_id_str;
u_int32_t router_id;
+ struct ospf6_area *oa;
+ struct listnode *node;
argv_find(argv, argc, "A.B.C.D", &idx);
router_id_str = argv[idx]->arg;
}
o->router_id_static = router_id;
- if (o->router_id == 0)
- o->router_id = router_id;
+
+ for (ALL_LIST_ELEMENTS_RO(o->area_list, node, oa)) {
+ if (oa->full_nbrs) {
+ vty_out(vty,
+ "For this router-id change to take effect,"
+ " save config and restart ospf6d\n");
+ return CMD_SUCCESS;
+ }
+ }
+
+ o->router_id = router_id;
return CMD_SUCCESS;
}
V4NOTATION_STR)
{
VTY_DECLVAR_CONTEXT(ospf6, o);
+ struct ospf6_area *oa;
+ struct listnode *node;
+
o->router_id_static = 0;
+
+ for (ALL_LIST_ELEMENTS_RO(o->area_list, node, oa)) {
+ if (oa->full_nbrs) {
+ vty_out(vty,
+ "For this router-id change to take effect,"
+ " save config and restart ospf6d\n");
+ return CMD_SUCCESS;
+ }
+ }
o->router_id = 0;
+ if (o->router_id_zebra.s_addr)
+ o->router_id = (uint32_t)o->router_id_zebra.s_addr;
return CMD_SUCCESS;
}
/* static router id */
u_int32_t router_id_static;
+ struct in_addr router_id_zebra;
+
/* start time */
struct timeval starttime;
/* information about zebra. */
struct zclient *zclient = NULL;
-struct in_addr router_id_zebra;
-
/* Router-id update message from zebra. */
static int ospf6_router_id_update_zebra(int command, struct zclient *zclient,
zebra_size_t length, vrf_id_t vrf_id)
struct ospf6 *o = ospf6;
zebra_router_id_update_read(zclient->ibuf, &router_id);
- router_id_zebra = router_id.u.prefix4;
if (o == NULL)
return 0;
+ o->router_id_zebra = router_id.u.prefix4;
+
if (o->router_id == 0)
- o->router_id = (u_int32_t)router_id_zebra.s_addr;
+ o->router_id = (uint32_t)o->router_id_zebra.s_addr;
return 0;
}