diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2023-01-30 16:02:23 -0500 | 
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2023-01-30 16:02:23 -0500 | 
| commit | 367b458cb444d005a6fc4606dcf7aca31c16e848 (patch) | |
| tree | 5618d2ab48097f9a7c8992a95384da4bd3d241ec /bgpd/bgp_flowspec.c | |
| parent | 65a78243d8cc27e8f3e5f3b20dbbe97ce48df308 (diff) | |
bgpd: bgp_update and bgp_withdraw never return failures
These two functions always return 0.  As such any and all
tests against this make no sense.  Remove the return 0
to a void and follow the chain, logically, to remove all
the dead code.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'bgpd/bgp_flowspec.c')
| -rw-r--r-- | bgpd/bgp_flowspec.c | 21 | 
1 files changed, 6 insertions, 15 deletions
diff --git a/bgpd/bgp_flowspec.c b/bgpd/bgp_flowspec.c index 39c0cfe514..b07625c49e 100644 --- a/bgpd/bgp_flowspec.c +++ b/bgpd/bgp_flowspec.c @@ -103,7 +103,6 @@ int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,  	safi_t safi;  	int psize = 0;  	struct prefix p; -	int ret;  	void *temp;  	/* Start processing the NLRI - there may be multiple in the MP_REACH */ @@ -190,21 +189,13 @@ int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,  		}  		/* Process the route. */  		if (!withdraw) -			ret = bgp_update(peer, &p, 0, attr, -					 afi, safi, -					 ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, -					 NULL, NULL, 0, 0, NULL); +			bgp_update(peer, &p, 0, attr, afi, safi, +				   ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, NULL, +				   NULL, 0, 0, NULL);  		else -			ret = bgp_withdraw(peer, &p, 0, attr, -					   afi, safi, -					   ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, -					   NULL, NULL, 0, NULL); -		if (ret) { -			flog_err(EC_BGP_FLOWSPEC_INSTALLATION, -				 "Flowspec NLRI failed to be %s.", -				 attr ? "added" : "withdrawn"); -			return BGP_NLRI_PARSE_ERROR; -		} +			bgp_withdraw(peer, &p, 0, attr, afi, safi, +				     ZEBRA_ROUTE_BGP, BGP_ROUTE_NORMAL, NULL, +				     NULL, 0, NULL);  	}  	return BGP_NLRI_PARSE_OK;  }  | 
