Skip to content

vrrp: interface add should call setup_interface() #2529

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

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

sshambar
Copy link
Contributor

When an interface is (re-)added, setup_interface() should be called even if vrrp->flags is set (eg VRRP_FLAG_NOPREEMPT).

Tests to avoid setup_interface() before commit a0ce04a checked vrrp->vmac_flags, but the change mistakenly mixed the test with other vrrp flags.

The bug manifests in cases where the only vrrp_instance on an interface uses a feature that sets a vrrp->flags bit (eg nopreempt), and then the interface is deleted and re-added (eg nmcli con down , nmcli con up ). The vrrp->flags value causes setup_interface() to not be called, and the vrrp interface never times-out to reach master state.

If other vrrp_instance's exist for the same interface, then the bug doesn't manifest (the other instance calls setup_interface, and the (eg nopreempt) instance will transition to master.

The patch reduces the tests to just the vmac/ipvlan bits

NOTE: I tried the code without any vrrp->flags tests, and at least the use_vmac mode appears to work perfectly (I didn't try ipvlan) -- I'm not sure why the vmac/ipvlan test is there really...

When an interface is (re-)added, setup_interface() should be called even if vrrp->flags is set (eg VRRP_FLAG_NOPREEMPT).

Tests to avoid setup_interface() before commit a0ce04a checked vrrp->vmac_flags, but the commit mistakenly mixed the test with other vrrp flags.

Signed-off-by: Scott Shambarger <[email protected]>
@pqarmitage pqarmitage merged commit 17241ae into acassen:master Jan 27, 2025
10 checks passed
@pqarmitage
Copy link
Collaborator

@sshambar Many thanks for identifying the problem and its origin, and providing the fix.

I have looked at commit a0ce04a and found another instance of if (vrrp->vmac_flags) being changed to if (vrrp->flags) (also in keepalived/vrrp/vrrp_if.c). Commit 82cdee1 resolves that instance of the problem as well.

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