Skip to content

Conversation

lilioid
Copy link

@lilioid lilioid commented Oct 11, 2025

Description

This change uses known IFA_F flags that are attached to interface addresses by the linux kernel to differentiate between the usability of multiple addresses.
Primarily, this deprioritizes temporary and completely excludes deprecated addresses that have been assigned to a node through RFC7217 address generation techniques. It also explicitly prioritizes addresses that are marked as "manually assigned" by the kernel.

This improves routing stability for all backends that require an address to reach a node.
Closes #2293 but generally speaking in any case where a node has multiple addresses to choose from, flannel should consciously choose the most useful and less likely to suddenly change.

Performed Testing

I have already patches this change into my own three-node linux k3s setup and have run manual end-to-end tests there. The change has the intended outcome in that temporary addresses are no longer chosen as primary addresses.

Todos

  • Tests
  • Documentation
  • Release note

Release Note

I do think a release note is required since this changes the way flannel chooses primary addresses which has potential impact in user deployments.
There should be no action required by a user during updates but they should be aware that after restarting flannel, the primary address chosen by it might be a different one than before the restart.
I have trouble finding a fitting formulation though.


This change uses known IFA_F flags that are attached to interface
addresses by the linux kernel to differentiate between the usability
of multiple addresses.
Primarily, this deprioritizes temporary and deprecated addresses
that have been assigned to a node through RFC7217 address generation
techniques. It also explicitly prioritizes addresses that are marked
as "manually assigned" by the kernel.

This improves routing stability for all backends that require an
address to reach a node.

See flannel-io#2293 for an example of why this is needed.

Signed-off-by: lilly <li@lly.sh>
@rbrtbnfgl rbrtbnfgl self-requested a review October 14, 2025 14:55
Copy link
Contributor

@rbrtbnfgl rbrtbnfgl left a comment

Choose a reason for hiding this comment

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

Hi. Thanks for the PR.
LGTM

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.

Host-GW backend chooses wrong IPv6 address as gateway

2 participants