-
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 a mDNS advertisement on minmdns server startup #4884
Do a mDNS advertisement on minmdns server startup #4884
Conversation
…plies to queries can be sent with link local information as well
…interface/capability yet
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.
Looks great, thank you!
f3fd002
to
9fecbf9
Compare
Size increase report for "nrfconnect-example-build" from 0e9c5b8
Full report output
|
Size increase report for "gn_qpg6100-example-build" from 0e9c5b8
Full report output
|
Size increase report for "esp32-example-build" from 0e9c5b8
Full report output
|
private: | ||
bool AcceptableQueryType(QType qType) | ||
{ | ||
if (mSendingAdditionalItems && mQueryData.IsBootAdvertising()) |
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.
Is this check needed (isn't the 2nd condition true already?)
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.
IsBootAdvertising is only set during initial boot, not during normal query replies, where as 'sending additional items' is set for any reply processing. I believe they are both needed.
|
||
bool AcceptablePath(FullQName qname) | ||
{ | ||
if (mIgnoreNameMatch || mQueryData.IsBootAdvertising()) |
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.
Why do we need IsBootAdvertising instead of just using IgnoreNameMatch ?
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.
It seemed to make the intent cleaner by having behaviour depend on query.
The boot-time broadcaster builds a fake query (so that the sender sends replies to such a query) however it does not have access to the underlying filtering used by the mDNS sender.
Alternative would be to propagate flags into the mdns sending and that seeemed to be a bit uglier.
return false; | ||
} | ||
|
||
if (strncmp(name, "lo", 2) == 0) |
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.
Not a new issue, but doesn't seem right that if I rename my interface to "lollipop" it will be skipped.
Probably the name is the wrong thing to look at altogether, and we should just inspect the address.
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 could find no better way.
For devices this may not be an issue (since they control their wifi name and it is likely LWIP anyway). Would people rename interfaces on android/iOS?
Added a TODO to auto-create an issue.
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.
Can't you just get the address and see if it's ::1 or inside 127.0.0.0/8 ?
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.
InterfaceIterator does not provide the address only InterfaceAddressIterator does.
Absolutely possible to use AddressIterator instead and do some dedup, but I find it more bothersome than what I would be generally add as a 'fix if you are already touching this'.
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.
Real fix would probably to fix the interface iterator to be able to return an address iterator for that specified interface. Having 2 types of iterators that both iterate over all interfaces is strange.
need a better way to ignore local loopback interfaces/addressesconnectedhomeip/src/lib/mdns/Advertiser_ImplMinimalMdns.cpp Lines 105 to 115 in d285703
This comment was generated by todo based on a
|
Problem
Devices should advertise that they exist at boot time, so that passive listeners can see such devices.
This is especially useful on commisioning devices (new devices appear) as well as in case IP address changes.
Summary of Changes
Note that this is not fully RFC compliant (RFC requires a re-advertisement after 10s). It just makes things more functional.
Fixes #4853