mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-16 21:22:29 +00:00
bgpd: vrf route leaking, fix the bgp instance delete and re-add
Description: FRR doesn't re-install the routes, imported from a tenant VRF, when bgp instance for source vrf is deleted and re-added again. When bgp instance is removed and re-added, when import statement is already there, then route leaking stops between two VRFs. Every 'router bgp' command should trigger re-export of all the routes to the importing bgp vrf instances. When a router bgp is configured, there could be bgp vrf instance(s) importing routes from this newly configured bgp vrf instance. We need to export routes from configured bgp vrf to VPN. This can impact performance, whenever we are testing scale from vrf route-leaking perspective. We should not trigger re-export for already existing bgp vrf instances. Co-authored-by: Santosh P K <sapk@vmware.com> Co-authored-by: Kantesh Mundaragi <kmundaragi@vmware.com> Signed-off-by: Abhinay Ramesh <rabhinay@vmware.com>
This commit is contained in:
parent
f19d77a086
commit
ef7c53e244
@ -123,7 +123,12 @@ int bgp_router_create(struct nb_cb_create_args *args)
|
|||||||
if (is_new_bgp && inst_type == BGP_INSTANCE_TYPE_DEFAULT)
|
if (is_new_bgp && inst_type == BGP_INSTANCE_TYPE_DEFAULT)
|
||||||
vpn_leak_postchange_all();
|
vpn_leak_postchange_all();
|
||||||
|
|
||||||
if (inst_type == BGP_INSTANCE_TYPE_VRF)
|
/*
|
||||||
|
* Check if we need to export to other VRF(s).
|
||||||
|
* Leak the routes to importing bgp vrf instances,
|
||||||
|
* only when new bgp vrf instance is configured.
|
||||||
|
*/
|
||||||
|
if (ret != BGP_INSTANCE_EXISTS)
|
||||||
bgp_vpn_leak_export(bgp);
|
bgp_vpn_leak_export(bgp);
|
||||||
|
|
||||||
UNSET_FLAG(bgp->vrf_flags, BGP_VRF_AUTO);
|
UNSET_FLAG(bgp->vrf_flags, BGP_VRF_AUTO);
|
||||||
|
@ -3402,7 +3402,7 @@ int bgp_get(struct bgp **bgp_val, as_t *as, const char *name,
|
|||||||
return ret;
|
return ret;
|
||||||
case BGP_SUCCESS:
|
case BGP_SUCCESS:
|
||||||
if (*bgp_val)
|
if (*bgp_val)
|
||||||
return ret;
|
return BGP_INSTANCE_EXISTS;
|
||||||
}
|
}
|
||||||
|
|
||||||
bgp = bgp_create(as, name, inst_type);
|
bgp = bgp_create(as, name, inst_type);
|
||||||
|
@ -1844,6 +1844,7 @@ enum bgp_clear_type {
|
|||||||
/* BGP error codes. */
|
/* BGP error codes. */
|
||||||
#define BGP_SUCCESS 0
|
#define BGP_SUCCESS 0
|
||||||
#define BGP_CREATED 1
|
#define BGP_CREATED 1
|
||||||
|
#define BGP_INSTANCE_EXISTS 2
|
||||||
#define BGP_ERR_INVALID_VALUE -1
|
#define BGP_ERR_INVALID_VALUE -1
|
||||||
#define BGP_ERR_INVALID_FLAG -2
|
#define BGP_ERR_INVALID_FLAG -2
|
||||||
#define BGP_ERR_INVALID_AS -3
|
#define BGP_ERR_INVALID_AS -3
|
||||||
|
Loading…
Reference in New Issue
Block a user