summaryrefslogtreecommitdiffstats
path: root/ospf6d/ospf6_top.c
diff options
context:
space:
mode:
authorJafar Al-Gharaibeh <Jafaral@users.noreply.github.com>2018-02-15 21:39:09 +0100
committerGitHub <noreply@github.com>2018-02-15 21:39:09 +0100
commite9847d4a5b620879f796605e3da74fc6554f55f8 (patch)
tree373fbb6a917a29606e1b88ea28cb2db8c46c7ede /ospf6d/ospf6_top.c
parentMerge pull request #1752 from donaldsharp/coverity_1 (diff)
parentospf6d: router-id change notify to restart ospf6d (diff)
downloadfrr-e9847d4a5b620879f796605e3da74fc6554f55f8.tar.xz
frr-e9847d4a5b620879f796605e3da74fc6554f55f8.zip
Merge pull request #1754 from chiragshah6/ospfv3_dev
ospf6d: Router-ID change notify to restart ospf6d
Diffstat (limited to 'ospf6d/ospf6_top.c')
-rw-r--r--ospf6d/ospf6_top.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c
index 200268c77..25d968fb6 100644
--- a/ospf6d/ospf6_top.c
+++ b/ospf6d/ospf6_top.c
@@ -335,6 +335,8 @@ DEFUN(ospf6_router_id,
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;
@@ -346,8 +348,17 @@ DEFUN(ospf6_router_id,
}
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;
}
@@ -360,8 +371,22 @@ DEFUN(no_ospf6_router_id,
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;
}