diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2020-11-06 18:21:50 -0500 | 
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2020-11-15 14:50:17 -0500 | 
| commit | 8a3f8f2e4ae1e8aaa3666fd8d38780e753bc09e7 (patch) | |
| tree | 6d39449fbe173f576de0c4309dc284d837a6edb1 /sharpd/sharp_zebra.c | |
| parent | 07414912cd55f1a8517242a16beada2623c49cfc (diff) | |
bgpd, lib, sharpd: Add enum for zclient_send_message return
Add a `enum zclient_send_status` for appropriate handling
of return codes from zclient_send_message.  Touch all the places
where we handle this.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'sharpd/sharp_zebra.c')
| -rw-r--r-- | sharpd/sharp_zebra.c | 12 | 
1 files changed, 4 insertions, 8 deletions
diff --git a/sharpd/sharp_zebra.c b/sharpd/sharp_zebra.c index 2ef9af897e..e88904097a 100644 --- a/sharpd/sharp_zebra.c +++ b/sharpd/sharp_zebra.c @@ -289,7 +289,8 @@ static bool route_add(const struct prefix *p, vrf_id_t vrf_id, uint8_t instance,  		api.backup_nexthop_num = i;  	} -	if (zclient_route_send(ZEBRA_ROUTE_ADD, zclient, &api) == 1) +	if (zclient_route_send(ZEBRA_ROUTE_ADD, zclient, &api) +	    == ZCLIENT_SEND_BUFFERED)  		return true;  	else  		return false; @@ -312,7 +313,8 @@ static bool route_delete(struct prefix *p, vrf_id_t vrf_id, uint8_t instance)  	api.instance = instance;  	memcpy(&api.prefix, p, sizeof(*p)); -	if (zclient_route_send(ZEBRA_ROUTE_DELETE, zclient, &api) == 1) +	if (zclient_route_send(ZEBRA_ROUTE_DELETE, zclient, &api) +	    == ZCLIENT_SEND_BUFFERED)  		return true;  	else  		return false; @@ -356,8 +358,6 @@ static void sharp_install_routes_restart(struct prefix *p, uint32_t count,  			return;  		}  	} - -	return;  }  void sharp_install_routes_helper(struct prefix *p, vrf_id_t vrf_id, @@ -409,8 +409,6 @@ static void sharp_remove_routes_restart(struct prefix *p, uint32_t count,  			return;  		}  	} - -	return;  }  void sharp_remove_routes_helper(struct prefix *p, vrf_id_t vrf_id, @@ -454,12 +452,10 @@ static void sharp_zclient_buffer_ready(void)  					     wb.instance, wb.nhgid, wb.nhg,  					     wb.backup_nhg, wb.routes);  		return; -		break;  	case SHARP_DELETE_ROUTES_RESTART:  		sharp_remove_routes_restart(&wb.p, wb.count, wb.vrf_id,  					    wb.instance, wb.routes);  		return; -		break;  	}  }  | 
