All daemons changed to flag an interface that has been moved to a vrf as DELETED instead of INTERNAL.
When they were flagged as IFINDEX_INTERNAL, ospf, rip, and isis would re-install them in the default
assuming that they were being "pre-defined" before the kernel definitions.
Ticket: CM-9265
Signed-off-by: Don Slice
Reviewed-by: Donald Sharp
if (! ifp) /* This may happen if we've just unregistered for a VRF. */
return 0;
- ifp->ifindex = IFINDEX_INTERNAL;
+ ifp->ifindex = IFINDEX_DELETED;
if (BGP_DEBUG (zebra, ZEBRA))
zlog_debug("Rx Intf del VRF %u IF %s", vrf_id, ifp->name);
for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
{
+ if (ifp->ifindex == IFINDEX_DELETED)
+ continue;
+
/* IF name */
vty_out (vty, "interface %s%s", ifp->name, VTY_NEWLINE);
write++;
in case there is configuration info attached to it. */
if_delete_retain(ifp);
- ifp->ifindex = IFINDEX_INTERNAL;
+ ifp->ifindex = IFINDEX_DELETED;
return 0;
}
deleted interfaces). */
unsigned int ifindex;
#define IFINDEX_INTERNAL 0
+#define IFINDEX_DELETED UINT_MAX
/* Zebra internal interface status */
u_char status;
ospf6_interface_if_del (ifp);
#endif /*0*/
- ifp->ifindex = IFINDEX_INTERNAL;
+ ifp->ifindex = IFINDEX_DELETED;
return 0;
}
if (memcmp (ifp->name, "VLINK", 5) == 0)
continue;
+ if (ifp->ifindex == IFINDEX_DELETED)
+ continue;
+
vty_out (vty, "!%s", VTY_NEWLINE);
vty_out (vty, "interface %s%s", ifp->name,
VTY_NEWLINE);
if (rn->info)
ospf_if_free ((struct ospf_interface *) rn->info);
- ifp->ifindex = IFINDEX_INTERNAL;
+ ifp->ifindex = IFINDEX_DELETED;
return 0;
}
/* To support pseudo interface do not free interface structure. */
/* if_delete(ifp); */
- ifp->ifindex = IFINDEX_INTERNAL;
+ ifp->ifindex = IFINDEX_DELETED;
return 0;
}
{
struct rip_interface *ri;
+ if (ifp->ifindex == IFINDEX_DELETED)
+ continue;
+
ri = ifp->info;
/* Do not display the interface if there is no
/* To support pseudo interface do not free interface structure. */
/* if_delete(ifp); */
- ifp->ifindex = IFINDEX_INTERNAL;
+ ifp->ifindex = IFINDEX_DELETED;
return 0;
}