Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib,*: add vrf id to pbr rule results zapi message #14533

Merged
merged 1 commit into from
Oct 9, 2023

Conversation

mjstapp
Copy link
Contributor

@mjstapp mjstapp commented Oct 5, 2023

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.

zebra/zapi_msg.c Outdated
@@ -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));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this really belong in the zclient_create_header?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know there's a slot there, but I was concerned about whether someone would mis-interpret ... something, so I kept the new value in the rule-specific encoding?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be about consistency. The vrf_id should be set properly in the header for the vrf we are talking about. We should be using VRF_DEFAULT there when the zapi command is VRF free. I have tried to follow this rule when doing the coding

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, makes sense: I'll push an update...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've pushed an update removing the zclient api change.

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 <[email protected]>
@mjstapp mjstapp force-pushed the fix_rule_notify_vrf branch from efe8455 to 4fabe90 Compare October 5, 2023 20:23
@mjstapp mjstapp requested a review from donaldsharp October 5, 2023 20:24
@donaldsharp
Copy link
Member

ci:rerun

@donaldsharp donaldsharp merged commit 556fdaa into FRRouting:master Oct 9, 2023
@mjstapp mjstapp deleted the fix_rule_notify_vrf branch October 12, 2023 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants