mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 07:37:29 +00:00
Merge pull request #7295 from donaldsharp/ospf_crash
ospfd: Prevent crash if transferring config amongst instances
This commit is contained in:
commit
5875867dba
@ -8135,13 +8135,26 @@ DEFUN (ip_ospf_area,
|
|||||||
ospf = ospf_lookup_instance(instance);
|
ospf = ospf_lookup_instance(instance);
|
||||||
|
|
||||||
if (instance && ospf == NULL) {
|
if (instance && ospf == NULL) {
|
||||||
|
/*
|
||||||
|
* At this point we know we have received
|
||||||
|
* an instance and there is no ospf instance
|
||||||
|
* associated with it. This means we are
|
||||||
|
* in a situation where we have an
|
||||||
|
* ospf command that is setup for a different
|
||||||
|
* process(instance). We need to safely
|
||||||
|
* remove the command from ourselves and
|
||||||
|
* allow the other instance(process) handle
|
||||||
|
* the configuration command.
|
||||||
|
*/
|
||||||
params = IF_DEF_PARAMS(ifp);
|
params = IF_DEF_PARAMS(ifp);
|
||||||
if (OSPF_IF_PARAM_CONFIGURED(params, if_area)) {
|
if (OSPF_IF_PARAM_CONFIGURED(params, if_area)) {
|
||||||
UNSET_IF_PARAM(params, if_area);
|
UNSET_IF_PARAM(params, if_area);
|
||||||
ospf = ospf_lookup_by_vrf_id(VRF_DEFAULT);
|
ospf = ospf_lookup_by_vrf_id(VRF_DEFAULT);
|
||||||
|
if (ospf) {
|
||||||
ospf_interface_area_unset(ospf, ifp);
|
ospf_interface_area_unset(ospf, ifp);
|
||||||
ospf->if_ospf_cli_count--;
|
ospf->if_ospf_cli_count--;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return CMD_NOT_MY_INSTANCE;
|
return CMD_NOT_MY_INSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user