Skip to content

Allow IPv6 deprecated address selection #88976

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

Conversation

jukkar
Copy link
Member

@jukkar jukkar commented Apr 23, 2025

This adjust the IPv6 source address selection so that it is possible to select deprecated IPv6 address if no preferred address is found.

From RFC 6724 chapter 5:

       Rule 3: Avoid deprecated addresses.
       If one of the two source addresses is "preferred" and one of them is
       "deprecated" (in the RFC 4862 sense), then prefer the one that is
       "preferred".

If we never select deprecated address, then it is possible that we found no suitable address even if a deprecated address would be available.

@jukkar jukkar force-pushed the fix/allow-ipv6-deprecated-address-selection branch from 21eb2e5 to b63f6b9 Compare April 24, 2025 07:48
@jukkar
Copy link
Member Author

jukkar commented Apr 24, 2025

Changed the address selection such a way that we allow deprecated address to be selected if it is a better match than the preferred one.

rlubos
rlubos previously approved these changes Apr 24, 2025
pdgendt
pdgendt previously approved these changes Apr 24, 2025
jukkar added 2 commits April 24, 2025 13:31
This adjust the IPv6 source address selection so that it is possible
to select deprecated IPv6 address if no better preferred address is found.

From RFC 6724 chapter 5:

   Rule 3: Avoid deprecated addresses.
   If one of the two source addresses is "preferred" and one of them is
   "deprecated" (in the RFC 4862 sense), then prefer the one that is
   "preferred".

   Rule 8: Use longest matching prefix.
   If CommonPrefixLen(SA, D) > CommonPrefixLen(SB, D), then prefer SA.
   Similarly, if CommonPrefixLen(SB, D) > CommonPrefixLen(SA, D), then
   prefer SB.

So the fix allows deprecated address to be selected if it is a better
match than the preferred one. The reasoning here is that an address with
a longer matching prefix is generally considered topologically closer to
the destination. Using such a source address can lead to more efficient
routing, as it's more likely that the source and destination are within
the same network segment or a closely related one.

Signed-off-by: Jukka Rissanen <[email protected]>
Make sure deprecated address is selected if no other address
is available.

Signed-off-by: Jukka Rissanen <[email protected]>
@jukkar jukkar dismissed stale reviews from pdgendt and rlubos via 31c744c April 24, 2025 10:33
@jukkar jukkar force-pushed the fix/allow-ipv6-deprecated-address-selection branch from b63f6b9 to 31c744c Compare April 24, 2025 10:33
@jukkar
Copy link
Member Author

jukkar commented Apr 24, 2025

  • CI fixes

@kartben kartben merged commit 0c1dca5 into zephyrproject-rtos:main Apr 25, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants