vxlan: convert some settings to tristate (LP: #2000712)#311
Merged
Conversation
Vxlan learning is enabled by default on Linux. On Netplan it's a boolean variable that we initialize with false and only include in the generated configuration if it's true. That means we can't disable it on vxlan interfaces even if we define mac-learning: false explicitly in the yaml file. That is not the ideal solution! The proper way to do that is defining it as a tristate variable but it requires changes in the netplan_vxlan structure. One bad side effect of this change is that the yaml configuration generated from netdefs and the NM/networkd configuration will contain the option mac-learning even if we don't have it in the original yaml. This addresses LP#2000712
Contributor
Author
|
I'm not really happy with this change, but it avoids ABI changes. There are other options that will not be emitted if they are false, but the problem doesn't really shows up when they are false by default on the system. The proper solution would be to convert all these options to tristates. |
added 2 commits
February 1, 2023 12:03
This reverts commit 94e9c22.
Settings mac-learning, arp-proxy and short-circuit were converted from gboolean to tristate. When these options are enabled by default in the backend, it's not possible to disable them via Netplan as it was including the option in the generated configuration only when it was set to true. It addresses LP#2000712
Contributor
Author
|
I converted three settings from gboolean to tristates. It's shouldn't change the struct size/layout as both types are actually ints. |
daniloegea
commented
Feb 1, 2023
slyon
approved these changes
Feb 1, 2023
Contributor
slyon
left a comment
There was a problem hiding this comment.
lgtm overall! Let's reduce that now unused handle_vxlan_bool helper and try to reduce the new test's size a bit, by using some of the available templates from base.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Vxlan learning is enabled by default on Linux. On Netplan it's a boolean variable that we initialize with false and only include in the generated configuration if it's true. That means we can't disable it on vxlan interfaces even if we define mac-learning: false explicitly in the yaml file.
This PR converts the settings mac-learning, arp-proxy and short-circuit from gboolean to tristate.
This addresses LP#2000712
Description
Checklist
make checksuccessfully.make check-coverage).