Skip to content

Conversation

@Pdoijode
Copy link
Contributor

@Pdoijode Pdoijode commented Jan 8, 2026

Modified zebra_gr_enabled_for_vrf() function to obtain the GR client instead of obtaining the client info in the caller function and then passing it to zebra_gr_enabled_for_vrf().

This addresses the following coverity issue:

*** CID 1668072:         Null pointer dereferences  (NULL_RETURNS)
/zebra/zebra_gr.c: 510             in zebra_gr_cleanup_of_non_gr_vrf()
504     		/*
505     		 * If GR is enabled for this VRF, then zebra
506     		 * would have done the stale cleanup when BGP
507     		 * indicated UPDATE_COMPLETE for this VRF for
508     		 * all gr-enabled afi-safis. So skip such VRFs.
509     		 */
>>>     CID 1668072:         Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing a pointer that might be "NULL" "client" when calling "zebra_gr_enabled_for_vrf".
510     		if (zebra_gr_enabled_for_vrf(client, vrf->vrf_id))
511     			continue;
512     
513     		for (afi = AFI_IP; afi <= AFI_IP6; afi++) {
514     			table = zvrf->table[afi][SAFI_UNICAST];
515     			if (!table)

Modified zebra_gr_enabled_for_vrf() function to obtain the
GR client instead of obtaining the client info in the caller
function and then passing it to zebra_gr_enabled_for_vrf()

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
@Pdoijode Pdoijode force-pushed the pdoijode/gr-coverity-fix-1 branch from f8f01d1 to fde722b Compare January 8, 2026 23:52
@ton31337
Copy link
Member

ton31337 commented Jan 9, 2026

Just to understand: what issue does it solve?

@Pdoijode
Copy link
Contributor Author

Pdoijode commented Jan 9, 2026

@ton31337 Added the issue to description

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants