summaryrefslogtreecommitdiff
path: root/ospfd/ospf_vty.c
diff options
context:
space:
mode:
Diffstat (limited to 'ospfd/ospf_vty.c')
-rw-r--r--ospfd/ospf_vty.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index db8e961b8b..bf2a8564f0 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -10027,7 +10027,7 @@ DEFUN (ospf_external_route_aggregation,
str2prefix_ipv4(argv[idx]->arg, &p);
- if (is_prefix_default(&p)) {
+ if (is_default_prefix4(&p)) {
vty_out(vty,
"Default address shouldn't be configured as summary address.\n");
return CMD_SUCCESS;
@@ -10068,7 +10068,7 @@ DEFUN (no_ospf_external_route_aggregation,
str2prefix_ipv4(argv[idx]->arg, &p);
- if (is_prefix_default(&p)) {
+ if (is_default_prefix4(&p)) {
vty_out(vty,
"Default address shouldn't be configured as summary address.\n");
return CMD_SUCCESS;
@@ -10361,7 +10361,7 @@ DEFUN (ospf_external_route_aggregation_no_adrvertise,
str2prefix_ipv4(argv[idx]->arg, &p);
- if (is_prefix_default(&p)) {
+ if (is_default_prefix4(&p)) {
vty_out(vty,
"Default address shouldn't be configured as summary address.\n");
return CMD_SUCCESS;
@@ -10397,7 +10397,7 @@ DEFUN (no_ospf_external_route_aggregation_no_adrvertise,
str2prefix_ipv4(argv[idx]->arg, &p);
- if (is_prefix_default(&p)) {
+ if (is_default_prefix4(&p)) {
vty_out(vty,
"Default address shouldn't be configured as summary address.\n");
return CMD_SUCCESS;
@@ -11389,6 +11389,11 @@ DEFPY (clear_ip_ospf_neighbor,
if (!ospf->oi_running)
continue;
+ if (nbr_id_str && IPV4_ADDR_SAME(&ospf->router_id, &nbr_id)) {
+ vty_out(vty, "Self router-id is not allowed.\r\n ");
+ return CMD_SUCCESS;
+ }
+
ospf_neighbor_reset(ospf, nbr_id, nbr_id_str);
}
@@ -12250,6 +12255,18 @@ static int ospf_cfg_write_helper_dis_rtr_walkcb(struct hash_bucket *bucket,
return HASHWALK_CONTINUE;
}
+static void config_write_ospf_gr(struct vty *vty, struct ospf *ospf)
+{
+ if (!ospf->gr_info.restart_support)
+ return;
+
+ if (ospf->gr_info.grace_period == OSPF_DFLT_GRACE_INTERVAL)
+ vty_out(vty, " graceful-restart\n");
+ else
+ vty_out(vty, " graceful-restart grace-period %u\n",
+ ospf->gr_info.grace_period);
+}
+
static int config_write_ospf_gr_helper(struct vty *vty, struct ospf *ospf)
{
if (ospf->is_helper_supported)
@@ -12464,7 +12481,8 @@ static int ospf_config_write_one(struct vty *vty, struct ospf *ospf)
/* Redistribute information print. */
config_write_ospf_redistribute(vty, ospf);
- /* Print gr helper configs */
+ /* Graceful Restart print */
+ config_write_ospf_gr(vty, ospf);
config_write_ospf_gr_helper(vty, ospf);
/* Print external route aggregation. */