vrf: add fixes and sync changes with bonding.c/bridge.c#79
Open
Linaro1985 wants to merge 5 commits into
Open
Conversation
Commits taken as a basis: - device: fix build error on 32 bit systems - debug: remove newline from debug messages - bridge: skip present toggle in bridge_free_member() when device is active Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
Unlike bridge members, VRF enslaved interfaces remain full L3 devices. Disabling IPv6 on them was copied from bridge.c but is semantically wrong for VRF: link-local addresses on VRF ports are needed for IPv6 routing protocols (BGP, OSPFv3) to function within the VRF domain. The Linux kernel VRF documentation confirms that enslaved interfaces participate in IPv4 and IPv6 stacks normally, with their routes automatically moved to the VRF-associated routing table. Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
vrf_empty is set unconditionally to true in vrf_apply_settings() and has no corresponding UCI attribute, so it can never be false. Its only observable effect is to always trigger force_active=true and device_set_present() in vrf_config_init(), and to make vrf_remove_member() return early so that force_active is never cleared and device_set_present(false) is never called when all ports are removed. This reflects the intended semantics: a VRF without ports is a valid and useful configuration. Replace the dead conditional with direct unconditional assignments, and drop the now-unreachable force_active/device_set_present block from vrf_remove_member() Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
Contributor
Author
|
ping @systemcrash @howels |
systemcrash
approved these changes
May 6, 2026
Contributor
systemcrash
left a comment
There was a problem hiding this comment.
These look like clean additions/changes.
Rename the static device_type descriptor from vrf_state_type to vrf_device_type for consistency with bridge_device_type and bonding_device_type. The _state suffix is misleading as it implies a connection to struct vrf_state, while this is a static type descriptor unrelated to per-instance state. Also remove a spurious blank line in vrf_member_update(). Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
Add the standard GPLv2 license header consistent with other netifd modules. Co-authored-by Felix Fietkau is noted as the bridge and bonding device management patterns were derived from his bridge.c and bonding.c. Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
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.
VRF support was originally based on bonding.c/bridge.c. Since being added to netifd, fixes have been made that did not make it into vrf.c. Therefore, let's bring in the missing changes.
Commits taken as a basis:
Also this PR contains next fixes: