-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Do not advertise temporary/deprecated IPv6 addresses by minimal mDNS on Linux #22009
Do not advertise temporary/deprecated IPv6 addresses by minimal mDNS on Linux #22009
Conversation
…s is temporary/deprecated/...
if (mCurAddr->ifa_flags & IFA_F_OPTIMISTIC) | ||
{ | ||
flags.Set(InterfaceAddressIterator::Flags::kNotFinal); | ||
} | ||
|
||
if (mCurAddr->ifa_flags & IFA_F_DADFAILED) | ||
{ | ||
flags.Set(InterfaceAddressIterator::Flags::kNotFinal); | ||
} | ||
|
||
if (mCurAddr->ifa_flags & IFA_F_TENTATIVE) | ||
{ | ||
flags.Set(InterfaceAddressIterator::Flags::kNotFinal); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest to ifdef those flasg separately in case some platforms like Android don't have all of them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect CI to detect this. I believe for android we care about IFA_F_OPTIMISTIC and DADFAILED, however the flags kNotFinal and such can remain the same as if a platform does not have that concept, the flags are not set. This is what currently happen for all non-linux
{ | ||
if (it.GetFlags().HasAny(InterfaceAddressIterator::Flags::kNotFinal, InterfaceAddressIterator::Flags::kTemporary, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add comment here and in IPv6 that we will not advertise addresses that are not current and stable
@@ -390,6 +390,13 @@ class InterfaceIterator | |||
class DLL_EXPORT InterfaceAddressIterator | |||
{ | |||
public: | |||
enum class Flags : uint8_t | |||
{ | |||
kNotFinal = (1 << 0), // Not yet valid: Optimistic/DAD failed/tentative |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like it's exposing Linux flags in an API that is mean to work across a range of platforms that may not have these granular flags.
Perhaps start with just one (since all of the logic below seems to be treating all of these the same), and expand in the future as needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The flags here correspond to RFC 8981 concepts, so I think they're universally meaningful (even if not exposed on all platforms).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to make it somewhat conceptual by saying not final
instead of providing linux flags. Beyond that, RFC concepts should be sufficient and we do not require all platforms to support them.
I was unsure if we can simplify more. We could in theory just have a kDoNotUse
flag and let each platform pick what the rules are, but that seems a bit rough. We can go that route as a followup.
PR #22009: Size comparison from 51d2c95 to 5b5dcac Increases (25 builds for bl602, cc13x2_26x2, efr32, esp32, linux, psoc6, telink)
Decreases (7 builds for cc13x2_26x2, nrfconnect, psoc6)
Full report (43 builds for bl602, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, telink)
|
Converting to draft: getting IFA_F flags is a bit more involved it seems and since it is linux-specific it does not seem as well documented. |
Closing as the changes to support this are likely larger and original PR and review likely does not apply. |
Add support for linux address setting fetch - figure out if an address is temporary/deprecated/...
Problem
Linux often has deprecated IPv6 addresses when a OTBR advertises such routes. The longer they run, the more addresses would show up and this causes an exponential growth in IP addresses that are used and reported by minmdnds.
This makes passing TC-RR-1.1 very hard and highly depending on the system running chip-tool.
Previously, with 15 controllers, the announcement phase was >8 seconds of blocking network operations, which impacted test timing enough to flake some testing.
Change overview
Allow interface address iterators to set flags for specific IP addresses for their status. Specifically for linux implemented detection for temporary/deprecated/non-final addresses.
Use such info during minmdns processing.
This improves/helps implement #21736
Testing
Manual testing on a system with multiple deprecated addresses, minmdns behaviour significantly less spammy.