vrrp: interface add should call setup_interface() #2529
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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...