diff options
author | Donald Sharp <sharpd@nvidia.com> | 2021-10-28 16:42:23 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2021-11-17 13:46:36 +0100 |
commit | f284c1322da96c3ea694b4243b83adaead95ded7 (patch) | |
tree | d012c8927f1afa76436aeb4ff66e04ce2a7b95c1 /zebra/zebra_dplane.c | |
parent | zebra: return void for dplane_ctx_get_pbr_iptable (diff) | |
download | frr-f284c1322da96c3ea694b4243b83adaead95ded7.tar.xz frr-f284c1322da96c3ea694b4243b83adaead95ded7.zip |
zebra: return void for dplane_ctx_get_pbr_ipset_entry
The dplane_ctx_get_pbr_ipset_entry function only
failed when the caller did not pass in a valid
usable pointer. Change the code to assert on
a pointer not being passed in and remove the
bool return
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra/zebra_dplane.c')
-rw-r--r-- | zebra/zebra_dplane.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index d02d0178c..20aa9b843 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -2171,15 +2171,14 @@ void dplane_ctx_get_pbr_ipset(const struct zebra_dplane_ctx *ctx, memcpy(ipset, &ctx->u.ipset, sizeof(struct zebra_pbr_ipset)); } -bool dplane_ctx_get_pbr_ipset_entry(const struct zebra_dplane_ctx *ctx, +void dplane_ctx_get_pbr_ipset_entry(const struct zebra_dplane_ctx *ctx, struct zebra_pbr_ipset_entry *entry) { DPLANE_CTX_VALID(ctx); - if (!entry) - return false; + assert(entry); + memcpy(entry, &ctx->u.ipset_entry.entry, sizeof(struct zebra_pbr_ipset_entry)); - return true; } /* @@ -5075,12 +5074,12 @@ static void kernel_dplane_log_detail(struct zebra_dplane_ctx *ctx) case DPLANE_OP_IPSET_ENTRY_DELETE: { struct zebra_pbr_ipset_entry ipent; - if (dplane_ctx_get_pbr_ipset_entry(ctx, &ipent)) - zlog_debug("Dplane ipset entry update op %s, unique(%u), ctx %p", - dplane_op2str(dplane_ctx_get_op(ctx)), - ipent.unique, ctx); + dplane_ctx_get_pbr_ipset_entry(ctx, &ipent); + zlog_debug( + "Dplane ipset entry update op %s, unique(%u), ctx %p", + dplane_op2str(dplane_ctx_get_op(ctx)), ipent.unique, + ctx); } break; - case DPLANE_OP_NEIGH_TABLE_UPDATE: zlog_debug("Dplane neigh table op %s, ifp %s, family %s", dplane_op2str(dplane_ctx_get_op(ctx)), |