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");
"%% 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",