diff options
| -rw-r--r-- | pimd/pim_nb_config.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/pimd/pim_nb_config.c b/pimd/pim_nb_config.c index 4bc78529a8..11cfe09964 100644 --- a/pimd/pim_nb_config.c +++ b/pimd/pim_nb_config.c @@ -2394,6 +2394,13 @@ int lib_interface_pim_address_family_mroute_oif_modify( struct ipaddr group_addr; const struct lyd_node *if_dnode; + iif = nb_running_get_entry(args->dnode, NULL, true); + pim_iifp = iif->info; + pim = pim_iifp->pim; + + oifname = yang_dnode_get_string(args->dnode, NULL); + oif = if_lookup_by_name(oifname, pim->vrf_id); + switch (args->event) { case NB_EV_VALIDATE: if_dnode = yang_dnode_get_parent(args->dnode, "interface"); @@ -2402,18 +2409,20 @@ int lib_interface_pim_address_family_mroute_oif_modify( "%% Enable PIM and/or IGMP on this interface first"); return NB_ERR_VALIDATION; } + +#ifdef PIM_ENFORCE_LOOPFREE_MFC + if (iif->ifindex == oif->ifindex) { + strlcpy(args->errmsg, + "% IIF same as OIF and loopfree enforcement is enabled; rejecting", + args->errmsg_len); + return NB_ERR_VALIDATION; + } +#endif break; case NB_EV_PREPARE: case NB_EV_ABORT: break; case NB_EV_APPLY: - iif = nb_running_get_entry(args->dnode, NULL, true); - pim_iifp = iif->info; - pim = pim_iifp->pim; - - oifname = yang_dnode_get_string(args->dnode, NULL); - oif = if_lookup_by_name(oifname, pim->vrf_id); - if (!oif) { snprintf(args->errmsg, args->errmsg_len, "No such interface name %s", |
