mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-04-29 20:04:11 +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. */
|
||||
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);
|
||||
|
@ -958,6 +958,9 @@ isis_interface_config_write (struct vty *vty)
|
||||
|
||||
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++;
|
||||
|
@ -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. */
|
||||
if_delete_retain(ifp);
|
||||
|
||||
ifp->ifindex = IFINDEX_INTERNAL;
|
||||
ifp->ifindex = IFINDEX_DELETED;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
1
lib/if.h
1
lib/if.h
@ -84,6 +84,7 @@ struct interface
|
||||
deleted interfaces). */
|
||||
unsigned int ifindex;
|
||||
#define IFINDEX_INTERNAL 0
|
||||
#define IFINDEX_DELETED UINT_MAX
|
||||
|
||||
/* Zebra internal interface 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);
|
||||
#endif /*0*/
|
||||
|
||||
ifp->ifindex = IFINDEX_INTERNAL;
|
||||
ifp->ifindex = IFINDEX_DELETED;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -9285,6 +9285,9 @@ config_write_interface (struct vty *vty)
|
||||
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);
|
||||
|
@ -148,7 +148,7 @@ ospf_interface_delete (int command, struct zclient *zclient,
|
||||
if (rn->info)
|
||||
ospf_if_free ((struct ospf_interface *) rn->info);
|
||||
|
||||
ifp->ifindex = IFINDEX_INTERNAL;
|
||||
ifp->ifindex = IFINDEX_DELETED;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -492,7 +492,7 @@ rip_interface_delete (int command, struct zclient *zclient,
|
||||
|
||||
/* To support pseudo interface do not free interface structure. */
|
||||
/* if_delete(ifp); */
|
||||
ifp->ifindex = IFINDEX_INTERNAL;
|
||||
ifp->ifindex = IFINDEX_DELETED;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1928,6 +1928,9 @@ rip_interface_config_write (struct vty *vty)
|
||||
{
|
||||
struct rip_interface *ri;
|
||||
|
||||
if (ifp->ifindex == IFINDEX_DELETED)
|
||||
continue;
|
||||
|
||||
ri = ifp->info;
|
||||
|
||||
/* 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. */
|
||||
/* if_delete(ifp); */
|
||||
ifp->ifindex = IFINDEX_INTERNAL;
|
||||
ifp->ifindex = IFINDEX_DELETED;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user