diff options
Diffstat (limited to 'ospfd')
| -rw-r--r-- | ospfd/ospf_interface.c | 7 | ||||
| -rw-r--r-- | ospfd/ospf_vty.c | 6 |
2 files changed, 13 insertions, 0 deletions
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c index eb7a8348e8..2fea385594 100644 --- a/ospfd/ospf_interface.c +++ b/ospfd/ospf_interface.c @@ -909,6 +909,13 @@ struct ospf_interface *ospf_vl_new(struct ospf *ospf, return NULL; } + if (ospf->vrf_id == VRF_UNKNOWN) { + if (IS_DEBUG_OSPF_EVENT) + zlog_debug( + "ospf_vl_new(): Alarm: cannot create pseudo interface in unknown VRF"); + return NULL; + } + if (IS_DEBUG_OSPF_EVENT) zlog_debug( "ospf_vl_new(): creating pseudo zebra interface vrf id %u", diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 4109ada64a..f998f2e5f2 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -892,6 +892,12 @@ ospf_find_vl_data(struct ospf *ospf, struct ospf_vl_config_data *vl_config) vl_data = ospf_vl_data_new(area, vl_config->vl_peer); if (vl_data->vl_oi == NULL) { vl_data->vl_oi = ospf_vl_new(ospf, vl_data); + if (!vl_data->vl_oi) { + ospf_vl_data_free(vl_data); + vty_out(vty, + "Can't create VL, check logs for more information\n"); + return NULL; + } ospf_vl_add(ospf, vl_data); ospf_spf_calculate_schedule(ospf, SPF_FLAG_CONFIG_CHANGE); |
