mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-13 22:57:45 +00:00
zebra: Fallback to default ns if nhg vrf lookup fails
If the vrf lookup fails, use the default namespace to find/delete the nexthop group from the kernel because it should be there anyway. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
This commit is contained in:
parent
f17f2c5d6c
commit
a7df21c4d2
@ -1573,6 +1573,7 @@ static int dplane_ctx_nexthop_init(struct zebra_dplane_ctx *ctx,
|
|||||||
enum dplane_op_e op,
|
enum dplane_op_e op,
|
||||||
struct nhg_hash_entry *nhe)
|
struct nhg_hash_entry *nhe)
|
||||||
{
|
{
|
||||||
|
struct zebra_vrf *zvrf = NULL;
|
||||||
struct zebra_ns *zns = NULL;
|
struct zebra_ns *zns = NULL;
|
||||||
|
|
||||||
int ret = EINVAL;
|
int ret = EINVAL;
|
||||||
@ -1597,7 +1598,13 @@ static int dplane_ctx_nexthop_init(struct zebra_dplane_ctx *ctx,
|
|||||||
ctx->u.rinfo.nhe.nh_grp_count = zebra_nhg_nhe2grp(
|
ctx->u.rinfo.nhe.nh_grp_count = zebra_nhg_nhe2grp(
|
||||||
ctx->u.rinfo.nhe.nh_grp, nhe, MULTIPATH_NUM);
|
ctx->u.rinfo.nhe.nh_grp, nhe, MULTIPATH_NUM);
|
||||||
|
|
||||||
zns = ((struct zebra_vrf *)vrf_info_lookup(nhe->vrf_id))->zns;
|
zvrf = vrf_info_lookup(nhe->vrf_id);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Fallback to default namespace if the vrf got ripped out from under
|
||||||
|
* us.
|
||||||
|
*/
|
||||||
|
zns = zvrf ? zvrf->zns : zebra_ns_lookup(NS_DEFAULT);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TODO: Might not need to mark this as an update, since
|
* TODO: Might not need to mark this as an update, since
|
||||||
|
Loading…
Reference in New Issue
Block a user