diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 741542f9bac5..36d226d52617 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -2423,10 +2423,11 @@ static int rule_notify_owner(ZAPI_CALLBACK_ARGS) enum zapi_rule_notify_owner note; struct bgp_pbr_action *bgp_pbra; struct bgp_pbr_rule *bgp_pbr = NULL; + vrf_id_t vrfid; char ifname[INTERFACE_NAMSIZ + 1]; if (!zapi_rule_notify_decode(zclient->ibuf, &seqno, &priority, &unique, - ifname, ¬e)) + &vrfid, ifname, ¬e)) return -1; bgp_pbra = bgp_pbr_action_rule_lookup(vrf_id, unique); diff --git a/lib/zclient.c b/lib/zclient.c index f8f9cf7aba05..97572cbac6ce 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -2024,16 +2024,18 @@ bool zapi_route_notify_decode(struct stream *s, struct prefix *p, } bool zapi_rule_notify_decode(struct stream *s, uint32_t *seqno, - uint32_t *priority, uint32_t *unique, char *ifname, + uint32_t *priority, uint32_t *unique, + vrf_id_t *vrfid, char *ifname, enum zapi_rule_notify_owner *note) { - uint32_t prio, seq, uni; + uint32_t prio, seq, uni, vrf_id; STREAM_GET(note, s, sizeof(*note)); STREAM_GETL(s, seq); STREAM_GETL(s, prio); STREAM_GETL(s, uni); + STREAM_GETL(s, vrf_id); STREAM_GET(ifname, s, INTERFACE_NAMSIZ); if (zclient_debug) @@ -2041,6 +2043,7 @@ bool zapi_rule_notify_decode(struct stream *s, uint32_t *seqno, *seqno = seq; *priority = prio; *unique = uni; + *vrfid = vrf_id; return true; diff --git a/lib/zclient.h b/lib/zclient.h index 2a3ce4e4880c..bddd9d41382d 100644 --- a/lib/zclient.h +++ b/lib/zclient.h @@ -1098,7 +1098,8 @@ bool zapi_route_notify_decode(struct stream *s, struct prefix *p, enum zapi_route_notify_owner *note, afi_t *afi, safi_t *safi); bool zapi_rule_notify_decode(struct stream *s, uint32_t *seqno, - uint32_t *priority, uint32_t *unique, char *ifname, + uint32_t *priority, uint32_t *unique, + vrf_id_t *vrfid, char *ifname, enum zapi_rule_notify_owner *note); bool zapi_ipset_notify_decode(struct stream *s, uint32_t *unique, diff --git a/pbrd/pbr_zebra.c b/pbrd/pbr_zebra.c index e8a49b3176fe..5fae5a0824f7 100644 --- a/pbrd/pbr_zebra.c +++ b/pbrd/pbr_zebra.c @@ -203,9 +203,10 @@ static int rule_notify_owner(ZAPI_CALLBACK_ARGS) struct pbr_map_interface *pmi; char ifname[INTERFACE_NAMSIZ + 1]; uint64_t installed; + vrf_id_t vrfid; if (!zapi_rule_notify_decode(zclient->ibuf, &seqno, &priority, &unique, - ifname, ¬e)) + &vrfid, ifname, ¬e)) return -1; pmi = NULL; diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index 86e4f2570cbe..beae7f283bb6 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -854,6 +854,7 @@ void zsend_rule_notify_owner(const struct zebra_dplane_ctx *ctx, stream_putl(s, dplane_ctx_rule_get_seq(ctx)); stream_putl(s, dplane_ctx_rule_get_priority(ctx)); stream_putl(s, dplane_ctx_rule_get_unique(ctx)); + stream_putl(s, dplane_ctx_rule_get_vrfid(ctx)); stream_put(s, dplane_ctx_rule_get_ifname(ctx), INTERFACE_NAMSIZ); stream_putw_at(s, 0, stream_get_endp(s)); diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index 03d7bb88a218..099a6e2725c1 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -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 **********************************************************************/ diff --git a/zebra/zebra_dplane.h b/zebra/zebra_dplane.h index 4d4a17bbaeba..87c2e0365677 100644 --- a/zebra/zebra_dplane.h +++ b/zebra/zebra_dplane.h @@ -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,