diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2021-05-12 14:31:45 -0400 | 
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2021-05-12 14:36:59 -0400 | 
| commit | d3cc1e45182196a0b9b7146bcbaef04f346d9721 (patch) | |
| tree | 2841feca90eae72f58a1c0c3e23af860db3f3b46 /pimd/pim_rp.c | |
| parent | e5981db7e9eda027c189d3d528f7e02c05faf29a (diff) | |
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 <sharpd@nvidia.com>
Diffstat (limited to 'pimd/pim_rp.c')
| -rw-r--r-- | pimd/pim_rp.c | 4 | 
1 files changed, 2 insertions, 2 deletions
diff --git a/pimd/pim_rp.c b/pimd/pim_rp.c index feaeea929d..a31fec036f 100644 --- a/pimd/pim_rp.c +++ b/pimd/pim_rp.c @@ -1159,7 +1159,7 @@ int pim_rp_config_write(struct pim_instance *pim, struct vty *vty,  bool pim_rp_check_is_my_ip_address(struct pim_instance *pim,  				   struct in_addr dest_addr)  { -	if (if_lookup_exact_address(&dest_addr, AF_INET, pim->vrf_id)) +	if (if_lookup_exact_address(&dest_addr, AF_INET, pim->vrf->vrf_id))  		return true;  	return false; @@ -1323,7 +1323,7 @@ void pim_resolve_rp_nh(struct pim_instance *pim, struct pim_neighbor *nbr)  				continue;  			struct interface *ifp1 = if_lookup_by_index( -				nh_node->ifindex, pim->vrf_id); +				nh_node->ifindex, pim->vrf->vrf_id);  			if (nbr->interface != ifp1)  				continue;  | 
