diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2021-10-28 09:15:44 -0400 | 
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2021-11-17 07:46:36 -0500 | 
| commit | 8249f96a5f667af016764219f501d5015104061d (patch) | |
| tree | dd337c6c4e790fcb09749110c29efec125fb8972 /zebra/zebra_dplane.c | |
| parent | 4be297235ed2555be598661d0d082a1ed8794355 (diff) | |
zebra: dplane_ctx_get_pbr_ipset should return void
The function call dplane_ctx_get_pbr_ipset only
returns false when the calling function fails to
pass in a valid ipset pointer.  This should
be an assertion issue since it's a programming
issue as opposed to an actual run time issue.
Change the function call parameter to not return
a bool on success/fail for a compile time decision.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra/zebra_dplane.c')
| -rw-r--r-- | zebra/zebra_dplane.c | 15 | 
1 files changed, 7 insertions, 8 deletions
diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index 3d258e0829..9c17ab6892 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -2155,13 +2155,13 @@ dplane_ctx_get_pbr_iptable(const struct zebra_dplane_ctx *ctx,  	return true;  } -bool dplane_ctx_get_pbr_ipset(const struct zebra_dplane_ctx *ctx, +void dplane_ctx_get_pbr_ipset(const struct zebra_dplane_ctx *ctx,  			      struct zebra_pbr_ipset *ipset)  {  	DPLANE_CTX_VALID(ctx); -	if (!ipset) -		return false; +	assert(ipset); +  	if (ctx->zd_op == DPLANE_OP_IPSET_ENTRY_ADD ||  	    ctx->zd_op == DPLANE_OP_IPSET_ENTRY_DELETE) {  		memset(ipset, 0, sizeof(struct zebra_pbr_ipset)); @@ -2171,7 +2171,6 @@ bool dplane_ctx_get_pbr_ipset(const struct zebra_dplane_ctx *ctx,  		       ZEBRA_IPSET_NAME_SIZE);  	} else  		memcpy(ipset, &ctx->u.ipset, sizeof(struct zebra_pbr_ipset)); -	return true;  }  bool dplane_ctx_get_pbr_ipset_entry(const struct zebra_dplane_ctx *ctx, @@ -5068,10 +5067,10 @@ static void kernel_dplane_log_detail(struct zebra_dplane_ctx *ctx)  	case DPLANE_OP_IPSET_DELETE: {  		struct zebra_pbr_ipset ipset; -		if (dplane_ctx_get_pbr_ipset(ctx, &ipset)) -			zlog_debug("Dplane ipset update op %s, unique(%u), ctx %p", -				   dplane_op2str(dplane_ctx_get_op(ctx)), -				   ipset.unique, ctx); +		dplane_ctx_get_pbr_ipset(ctx, &ipset); +		zlog_debug("Dplane ipset update op %s, unique(%u), ctx %p", +			   dplane_op2str(dplane_ctx_get_op(ctx)), ipset.unique, +			   ctx);  	} break;  	case DPLANE_OP_IPSET_ENTRY_ADD:  	case DPLANE_OP_IPSET_ENTRY_DELETE: {  | 
