summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2021-10-28 10:42:23 -0400
committerDonald Sharp <sharpd@nvidia.com>2021-11-17 07:46:36 -0500
commitf284c1322da96c3ea694b4243b83adaead95ded7 (patch)
treed012c8927f1afa76436aeb4ff66e04ce2a7b95c1
parent8d78e148b852ee31399d9a66af948cf604016ebe (diff)
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>
-rw-r--r--zebra/zapi_msg.c3
-rw-r--r--zebra/zebra_dplane.c17
-rw-r--r--zebra/zebra_dplane.h5
-rw-r--r--zebra/zebra_pbr.c3
4 files changed, 12 insertions, 16 deletions
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;