From d3cc1e45182196a0b9b7146bcbaef04f346d9721 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 12 May 2021 14:31:45 -0400 Subject: pimd: Remove pim->vrf_id and use pim->vrf->vrf_id VRF creation can happen from either cli or from knowledged about the vrf learned from zebra. In the case where we learn about the vrf from the cli, the vrf id is UNKNOWN. Upon actual creation of the vrf, lib/vrf.c touches up the vrf_id and calls pim_vrf_enable to turn it on properly. At this point in time we have a pim->vrf_id of UNKNOWN and the vrf->vrf_id of the right value. There is no point in duplicating this data. So just remove all pim->vrf_id and use the vrf->vrf_id instead since we keep a copy of the pim->vrf pointer. This will remove some crashes where we expect the pim->vrf_id to be usable and it's not. Signed-off-by: Donald Sharp --- pimd/pim_pim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pimd/pim_pim.c') diff --git a/pimd/pim_pim.c b/pimd/pim_pim.c index 4ba08a19d8..e7ac0d4e5b 100644 --- a/pimd/pim_pim.c +++ b/pimd/pim_pim.c @@ -369,7 +369,7 @@ static int pim_sock_read(struct thread *t) * the right ifindex, so just use it. We know * it's the right interface because we bind to it */ - ifp = if_lookup_by_index(ifindex, pim_ifp->pim->vrf_id); + ifp = if_lookup_by_index(ifindex, pim_ifp->pim->vrf->vrf_id); if (!ifp || !ifp->info) { if (PIM_DEBUG_PIM_PACKETS) zlog_debug( -- cgit v1.2.3