mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-06-15 15:04:00 +00:00
quagga: delete interface from default table when moved to vrf
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
This commit is contained in:
parent
419b65eed2
commit
84361d615d
@ -319,7 +319,7 @@ bgp_interface_delete (int command, struct zclient *zclient,
|
|||||||
if (! ifp) /* This may happen if we've just unregistered for a VRF. */
|
if (! ifp) /* This may happen if we've just unregistered for a VRF. */
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
ifp->ifindex = IFINDEX_INTERNAL;
|
ifp->ifindex = IFINDEX_DELETED;
|
||||||
|
|
||||||
if (BGP_DEBUG (zebra, ZEBRA))
|
if (BGP_DEBUG (zebra, ZEBRA))
|
||||||
zlog_debug("Rx Intf del VRF %u IF %s", vrf_id, ifp->name);
|
zlog_debug("Rx Intf del VRF %u IF %s", vrf_id, ifp->name);
|
||||||
|
@ -958,6 +958,9 @@ isis_interface_config_write (struct vty *vty)
|
|||||||
|
|
||||||
for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
|
for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
|
||||||
{
|
{
|
||||||
|
if (ifp->ifindex == IFINDEX_DELETED)
|
||||||
|
continue;
|
||||||
|
|
||||||
/* IF name */
|
/* IF name */
|
||||||
vty_out (vty, "interface %s%s", ifp->name, VTY_NEWLINE);
|
vty_out (vty, "interface %s%s", ifp->name, VTY_NEWLINE);
|
||||||
write++;
|
write++;
|
||||||
|
@ -116,7 +116,7 @@ isis_zebra_if_del (int command, struct zclient *zclient, zebra_size_t length,
|
|||||||
in case there is configuration info attached to it. */
|
in case there is configuration info attached to it. */
|
||||||
if_delete_retain(ifp);
|
if_delete_retain(ifp);
|
||||||
|
|
||||||
ifp->ifindex = IFINDEX_INTERNAL;
|
ifp->ifindex = IFINDEX_DELETED;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
1
lib/if.h
1
lib/if.h
@ -84,6 +84,7 @@ struct interface
|
|||||||
deleted interfaces). */
|
deleted interfaces). */
|
||||||
unsigned int ifindex;
|
unsigned int ifindex;
|
||||||
#define IFINDEX_INTERNAL 0
|
#define IFINDEX_INTERNAL 0
|
||||||
|
#define IFINDEX_DELETED UINT_MAX
|
||||||
|
|
||||||
/* Zebra internal interface status */
|
/* Zebra internal interface status */
|
||||||
u_char status;
|
u_char status;
|
||||||
|
@ -128,7 +128,7 @@ ospf6_zebra_if_del (int command, struct zclient *zclient, zebra_size_t length,
|
|||||||
ospf6_interface_if_del (ifp);
|
ospf6_interface_if_del (ifp);
|
||||||
#endif /*0*/
|
#endif /*0*/
|
||||||
|
|
||||||
ifp->ifindex = IFINDEX_INTERNAL;
|
ifp->ifindex = IFINDEX_DELETED;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9285,6 +9285,9 @@ config_write_interface (struct vty *vty)
|
|||||||
if (memcmp (ifp->name, "VLINK", 5) == 0)
|
if (memcmp (ifp->name, "VLINK", 5) == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (ifp->ifindex == IFINDEX_DELETED)
|
||||||
|
continue;
|
||||||
|
|
||||||
vty_out (vty, "!%s", VTY_NEWLINE);
|
vty_out (vty, "!%s", VTY_NEWLINE);
|
||||||
vty_out (vty, "interface %s%s", ifp->name,
|
vty_out (vty, "interface %s%s", ifp->name,
|
||||||
VTY_NEWLINE);
|
VTY_NEWLINE);
|
||||||
|
@ -148,7 +148,7 @@ ospf_interface_delete (int command, struct zclient *zclient,
|
|||||||
if (rn->info)
|
if (rn->info)
|
||||||
ospf_if_free ((struct ospf_interface *) rn->info);
|
ospf_if_free ((struct ospf_interface *) rn->info);
|
||||||
|
|
||||||
ifp->ifindex = IFINDEX_INTERNAL;
|
ifp->ifindex = IFINDEX_DELETED;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -492,7 +492,7 @@ rip_interface_delete (int command, struct zclient *zclient,
|
|||||||
|
|
||||||
/* To support pseudo interface do not free interface structure. */
|
/* To support pseudo interface do not free interface structure. */
|
||||||
/* if_delete(ifp); */
|
/* if_delete(ifp); */
|
||||||
ifp->ifindex = IFINDEX_INTERNAL;
|
ifp->ifindex = IFINDEX_DELETED;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1928,6 +1928,9 @@ rip_interface_config_write (struct vty *vty)
|
|||||||
{
|
{
|
||||||
struct rip_interface *ri;
|
struct rip_interface *ri;
|
||||||
|
|
||||||
|
if (ifp->ifindex == IFINDEX_DELETED)
|
||||||
|
continue;
|
||||||
|
|
||||||
ri = ifp->info;
|
ri = ifp->info;
|
||||||
|
|
||||||
/* Do not display the interface if there is no
|
/* Do not display the interface if there is no
|
||||||
|
@ -320,7 +320,7 @@ ripng_interface_delete (int command, struct zclient *zclient,
|
|||||||
|
|
||||||
/* To support pseudo interface do not free interface structure. */
|
/* To support pseudo interface do not free interface structure. */
|
||||||
/* if_delete(ifp); */
|
/* if_delete(ifp); */
|
||||||
ifp->ifindex = IFINDEX_INTERNAL;
|
ifp->ifindex = IFINDEX_DELETED;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user