Comments (7)
@abtink I have confirmed that your PR #9339 solves my issue. Thank you again for the quick assistance!
from ot-nrf528xx.
@tom-brown-kr I have a guess/theory of why it is not working.
The CNAME RR are used to provide a different name for a host name.
In the response there seems to two levels CNAME name changes happening:
- The name you queried is mapped to
-support.private-...
and then the-support.private...
name is again mapped to.azuremicro...
name and A record is provided for this name
In the Dns::Clinet
implementation we do check for one level of indirection (we check if there is CNAME
and we use the new name instead in Client::Response::CheckForHostNameAlias
) but not if there are multiple CNAME records and multiple name changes. We can add this in the code to support this.
from ot-nrf528xx.
@abtink Thank you for the quick investigation - support for multiple CNAMEs would be greatly appreciated. I will be sure to read through dns_client.cpp
in more detail for my own education.
Do you know approximately how long it might take to commit an update?
from ot-nrf528xx.
@abtink As it turns out, CheckForHostNameAlias()
is written in a way that is very easy to iterate! The // <-
comments below indicate my changes and additions.
Error Client::Response::CheckForHostNameAlias(Section aSection, Name &aHostName) const
{
// If the response includes a CNAME record mapping the query host
// name to a canonical name, we update `aHostName` to the new alias
// name. Otherwise `aHostName` remains as before.
Error findRecError, error; // <- added findRecError
uint16_t offset;
uint16_t numRecords;
CnameRecord cnameRecord;
int i=0;
const int i_maxcounter = 20; // <- added i_maxcounter
VerifyOrExit(mMessage != nullptr, error = kErrorNotFound);
do { // <- added do-while loop to iterate through one or more CNAME record(s). i_maxcounter prevents infinite while loop
SelectSection(aSection, offset, numRecords);
error = ResourceRecord::FindRecord(*mMessage, offset, numRecords, /* aIndex */ 0, aHostName, cnameRecord);
findRecError = error; // <- use findRecError to avoid interfering with current returning of "error"
switch (error)
{
case kErrorNone:
// A CNAME record was found. `offset` now points to after the
// last read byte within the `mMessage` into the `cnameRecord`
// (which is the start of the new canonical name).
aHostName.SetFromMessage(*mMessage, offset);
error = Name::ParseName(*mMessage, offset);
break;
case kErrorNotFound:
error = kErrorNone;
break;
default:
break;
}
i+=1;
} while(findRecError==kErrorNone && i<=i_maxcounter);
exit:
return error;
}
If I modify the comments and double-check your guidelines/conventions, could I submit a pull request for this? Is there anything you would recommend changing?
from ot-nrf528xx.
Just saw this. I am actually adding support for this in the code now. Will submit a PR soon.
from ot-nrf528xx.
Submitted the PR below which should help address this:
@tom-brown-kr it would be great if you can cherry-pick this and test it with your setup, so we can validate it :)
from ot-nrf528xx.
@tom-brown-kr, awesome. Thanks helping validate the PR quickly. :)
from ot-nrf528xx.
Related Issues (20)
- UART Abstraction hangs in otPlatUartFlush HOT 5
- Noob - Build options for OTBR RCP build HOT 6
- Nordic nRF52840DK - Unexpected RCP reset while running ot-daemon HOT 9
- [C] Platform------: HandleRcpTimeout() at radio_spinel_impl.hpp HOT 8
- NRF52840 dongle RCP via UART HOT 2
- RCP fails on Nordic nRF52840 DK HOT 4
- Problem with attaching devices HOT 5
- Problem with flashing OpenThread on Adafruit Feather nRF52840 Express HOT 1
- Adafruit Feather nRF52840 not shown as USB Device HOT 2
- [mdk] Request to update mdk to an up-to-date version HOT 2
- Nordic's nRF5340 DK support Request #8268 HOT 1
- E104-BT5040u USB Stick does not enter DFU mode after initial flashing HOT 4
- cant flash nrf52 dongle using nRFconnect for desktop. HOT 2
- nRF52840-Dongle with dual-bootloader setup HOT 1
- Missing content in CLI output of an OpenThread FTD running on nRF52840 DK HOT 15
- RCP unexcpected reset after starting ot-daemon HOT 2
- /opt/nrfjprog/: No such file or directory HOT 15
- How to make ot-br-posix enable OT_BLE_TACT? HOT 17
- The first compilation after git pull code fails
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ot-nrf528xx.