]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib,*: add vrf id to pbr rule results zapi message
authorMark Stapp <mjs@labn.net>
Thu, 5 Oct 2023 15:02:42 +0000 (11:02 -0400)
committerMark Stapp <mjs@labn.net>
Thu, 5 Oct 2023 20:22:40 +0000 (16:22 -0400)
The iprule/pbr rule object has a vrf id, and zebra uses
that internally, but the vrf id isn't returned to clients
who install rules and are waiting for results. Include the
vrf_id sent by the client in the zapi result notification
message; update the existing clients so they decode the id.

Signed-off-by: Mark Stapp <mjs@labn.net>
zebra/zapi_msg.c
zebra/zebra_dplane.c
zebra/zebra_dplane.h

index 86e4f2570cbec7a5e8877c66dbd8a07aea1b38dd..e59c49f15e1c1eecf3660ae5109b10406ec1cb19 100644 (file)
@@ -849,7 +849,9 @@ void zsend_rule_notify_owner(const struct zebra_dplane_ctx *ctx,
 
        s = stream_new(ZEBRA_MAX_PACKET_SIZ);
 
-       zclient_create_header(s, ZEBRA_RULE_NOTIFY_OWNER, VRF_DEFAULT);
+       zclient_create_header(s, ZEBRA_RULE_NOTIFY_OWNER,
+                             dplane_ctx_rule_get_vrfid(ctx));
+
        stream_put(s, &note, sizeof(note));
        stream_putl(s, dplane_ctx_rule_get_seq(ctx));
        stream_putl(s, dplane_ctx_rule_get_priority(ctx));
index 03d7bb88a2183b468a64a5bbe577d156beff2c4c..099a6e2725c19b72f8f3f86fb4bb922fccf519e7 100644 (file)
@@ -3031,6 +3031,13 @@ void dplane_ctx_rule_set_dp_flow_ptr(struct zebra_dplane_ctx *ctx,
        ctx->u.rule.new.dp_flow_ptr = dp_flow_ptr;
 }
 
+vrf_id_t dplane_ctx_rule_get_vrfid(const struct zebra_dplane_ctx *ctx)
+{
+       DPLANE_CTX_VALID(ctx);
+
+       return ctx->u.rule.new.prule.vrf_id;
+}
+
 /***********************************************************************
  *             PBR RULE ACCESSORS - end
  **********************************************************************/
index 4d4a17bbaeba0c58cffcdcccabad6628f399f5fe..87c2e03656778f6653afc056de138927a0868f1f 100644 (file)
@@ -740,6 +740,8 @@ intptr_t
 dplane_ctx_rule_get_old_dp_flow_ptr(const struct zebra_dplane_ctx *ctx);
 void dplane_ctx_rule_set_dp_flow_ptr(struct zebra_dplane_ctx *ctx,
                                     intptr_t dp_flow_ptr);
+vrf_id_t dplane_ctx_rule_get_vrfid(const struct zebra_dplane_ctx *ctx);
+
 /* Accessors for policy based routing iptable information */
 struct zebra_pbr_iptable;
 void dplane_ctx_get_pbr_iptable(const struct zebra_dplane_ctx *ctx,