]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: return void for dplane_ctx_get_pbr_ipset_entry
authorDonald Sharp <sharpd@nvidia.com>
Thu, 28 Oct 2021 14:42:23 +0000 (10:42 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Wed, 17 Nov 2021 12:46:36 +0000 (07:46 -0500)
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>
zebra/zapi_msg.c
zebra/zebra_dplane.c
zebra/zebra_dplane.h
zebra/zebra_pbr.c

index 5bacf1f40a6c5e0c86b7d481db0786c8a75c58c3..54ab0afd5ceec91fd5a9a94f021269b0d336d616 100644 (file)
@@ -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)
index d02d0178cc95b4a7140c3b9bb775f5225009d1f9..20aa9b84327f56e34b801540c07043d38f3b072b 100644 (file)
@@ -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)),
index ea408116ee0650027d264ff05533becd4ccc22bf..977f00bd2ad396a0b24d6ae067feced1f5466df4 100644 (file)
@@ -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
index 8b98cdc688a0c1f71cd17be6d69f79f6630141e9..e66d7aaf5c8aab9fe1c405db9d9006fa73d07698 100644 (file)
@@ -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;