Skip to content

Commit

Permalink
Merge pull request #1609 from dwalton76/ospf-reconfigure-area
Browse files Browse the repository at this point in the history
ospfd: do not complain if same area is reconfigured
  • Loading branch information
riw777 authored Jan 11, 2018
2 parents 51f682b + 2b0a905 commit c124004
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ospfd/ospf_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ DEFUN (ospf_network_area,
ret = ospf_network_set(ospf, &p, area_id, format);
if (ret == 0) {
vty_out(vty, "There is already same network statement.\n");
return CMD_WARNING;
return CMD_WARNING_CONFIG_FAILED;
}

return CMD_SUCCESS;
Expand Down
10 changes: 8 additions & 2 deletions ospfd/ospfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1031,9 +1031,15 @@ int ospf_network_set(struct ospf *ospf, struct prefix_ipv4 *p,

rn = route_node_get(ospf->networks, (struct prefix *)p);
if (rn->info) {
/* There is already same network statement. */
network = rn->info;
route_unlock_node(rn);
return 0;

if (IPV4_ADDR_SAME(&area_id, &network->area_id)) {
return 1;
} else {
/* There is already same network statement. */
return 0;
}
}

rn->info = network = ospf_network_new(area_id);
Expand Down

0 comments on commit c124004

Please sign in to comment.