diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index 5bacf1f40a..54ab0afd5c 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -940,8 +940,7 @@ void zsend_ipset_entry_notify_owner(const struct zebra_dplane_ctx *ctx, struct zebra_pbr_ipset ipset; uint16_t cmd = ZEBRA_IPSET_ENTRY_NOTIFY_OWNER; - if (!dplane_ctx_get_pbr_ipset_entry(ctx, &ipent)) - return; + dplane_ctx_get_pbr_ipset_entry(ctx, &ipent); dplane_ctx_get_pbr_ipset(ctx, &ipset); if (IS_ZEBRA_DEBUG_PACKET) diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index d02d0178cc..20aa9b8432 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)), diff --git a/zebra/zebra_dplane.h b/zebra/zebra_dplane.h index ea408116ee..977f00bd2a 100644 --- a/zebra/zebra_dplane.h +++ b/zebra/zebra_dplane.h @@ -532,9 +532,8 @@ struct zebra_pbr_ipset; void dplane_ctx_get_pbr_ipset(const struct zebra_dplane_ctx *ctx, struct zebra_pbr_ipset *ipset); struct zebra_pbr_ipset_entry; -bool -dplane_ctx_get_pbr_ipset_entry(const struct zebra_dplane_ctx *ctx, - struct zebra_pbr_ipset_entry *entry); +void dplane_ctx_get_pbr_ipset_entry(const struct zebra_dplane_ctx *ctx, + struct zebra_pbr_ipset_entry *entry); /* Accessors for bridge port information */ uint32_t dplane_ctx_get_br_port_flags(const struct zebra_dplane_ctx *ctx); uint32_t diff --git a/zebra/zebra_pbr.c b/zebra/zebra_pbr.c index 8b98cdc688..e66d7aaf5c 100644 --- a/zebra/zebra_pbr.c +++ b/zebra/zebra_pbr.c @@ -591,8 +591,7 @@ void zebra_pbr_process_ipset_entry(struct zebra_dplane_ctx *ctx) else mode = 0; - if (!dplane_ctx_get_pbr_ipset_entry(ctx, &ipset_entry)) - return; + dplane_ctx_get_pbr_ipset_entry(ctx, &ipset_entry); dplane_ctx_get_pbr_ipset(ctx, &ipset); ipset_entry.backpointer = &ipset;