Merge pull request #16309 from louis-6wind/fix-pim-crash

pimd: fix crash on non-existent interface
This commit is contained in:
Donald Sharp 2024-07-22 12:37:51 -04:00 committed by GitHub
commit 703beba119
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1504,11 +1504,19 @@ int routing_control_plane_protocols_control_plane_protocol_pim_address_family_re
*/
int lib_interface_pim_address_family_create(struct nb_cb_create_args *args)
{
struct interface *ifp;
switch (args->event) {
case NB_EV_VALIDATE:
case NB_EV_PREPARE:
case NB_EV_ABORT:
case NB_EV_APPLY:
case NB_EV_ABORT:
break;
case NB_EV_PREPARE:
ifp = nb_running_get_entry(args->dnode, NULL, true);
if (ifp->info)
return NB_OK;
pim_if_new(ifp, false, false, false, false);
break;
}