diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-08-24 19:54:21 -0400 | 
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-08-24 20:34:28 -0400 | 
| commit | e691f179b6c6fc26536e68958f19ff6983a03274 (patch) | |
| tree | 9b00aba37c7ce79b5f51b314d1a7aa66fa127682 /pimd/pim_instance.c | |
| parent | cc9b06ad5e58968356ab4edf30f3fd9eb7583b47 (diff) | |
pimd: Cleanup a variety of SA issues
1) Error check return from setsockopt and sockets
2) Check return codes for str2prefix
3) Clean up some potential NULL References
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_instance.c')
| -rw-r--r-- | pimd/pim_instance.c | 15 | 
1 files changed, 10 insertions, 5 deletions
diff --git a/pimd/pim_instance.c b/pimd/pim_instance.c index 7fc77556ec..d1f8085b48 100644 --- a/pimd/pim_instance.c +++ b/pimd/pim_instance.c @@ -195,11 +195,16 @@ static int pim_vrf_config_write(struct vty *vty)  	RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)  	{  		pim = vrf->info; -		if (!pim || vrf->vrf_id != VRF_DEFAULT) { -			vty_out(vty, "vrf %s\n", vrf->name); -			pim_global_config_write_worker(pim, vty); -			vty_out(vty, "!\n"); -		} + +		if (!pim) +			continue; + +		if (vrf->vrf_id == VRF_DEFAULT) +			continue; + +		vty_out(vty, "vrf %s\n", vrf->name); +		pim_global_config_write_worker(pim, vty); +		vty_out(vty, "!\n");  	}  	return 0;  | 
