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

fix lr-lb dnat with multiple distributed gateway ports #227

Closed
wants to merge 2 commits into from

Conversation

zcq98
Copy link

@zcq98 zcq98 commented Dec 1, 2023

#222

is_chassis_resident and output in “lr_out_undnat” is not set correctly when there are multiple gw ports.

When lr has multiple gw ports, LB VIP should determine is_chassis_resident and outport based on the LRP's subnet to which it belongs.If there is no matching subnet, l3dgw_ports[0] will be used by default.

northd/northd.c Outdated
est_match_p = xasprintf("%s && is_chassis_resident(%s)",
est_match,
od->l3dgw_ports[0]->cr_port->json_key);
if (od->n_l3dgw_ports > 1) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

What if the VIP is not in any of the LRP's subnets?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, we probably need some tests to ensure this behavior doesn't change by accident in the future.

@dceara
Copy link
Collaborator

dceara commented Dec 20, 2023

Please also sign-off on your commits so we can accept them in the repository.

Never mind, I missed the sign off in the commit log but it's already there. Sorry for the noise.

Signed-off-by: zcq98 <zhaocongqi_yewu@cmss.chinamobile.com>
Signed-off-by: zcq98 <zhaocongqi_yewu@cmss.chinamobile.com>
@zcq98
Copy link
Author

zcq98 commented Dec 22, 2023

hi @dceara,could you help review this ?

@dceara
Copy link
Collaborator

dceara commented Jan 3, 2024

Please target the main branch when opening the PR.

Copy link
Collaborator

@dceara dceara left a comment

Choose a reason for hiding this comment

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

Is it worth mentioning this change in the NEWS file? We didn't support LR LBs with multiple gw ports and with this we will, so it seems like it's a user-visible change.

static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 1);
VLOG_WARN_RL(&rl,
"No matched LRP's subnet for VIP %s",
lb_vip->vip_str);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is your intention to log when no GW port has a subnet matching the VIP? If so, this will log for every port that doesn't match the VIP and that seems wrong to me.

@zcq98 zcq98 closed this Jan 17, 2024
@zcq98 zcq98 deleted the branch-22.12-bugfix branch June 24, 2024 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants