mirror of
https://github.com/espressif/openthread.git
synced 2026-06-06 05:24:51 +00:00
[srp-client] exclude sub-type PTR when service is being removed (#7883)
This commit updates the SRP client to not include sub-types PTR records when the base service is being removed.
This commit is contained in:
committed by
GitHub
parent
742b4e8cc3
commit
8aca0655e7
@@ -1001,7 +1001,7 @@ Error Client::AppendServiceInstructions(Service &aService, Message &aMessage, In
|
||||
UpdateRecordLengthInMessage(rr, offset, aMessage);
|
||||
aInfo.mRecordCount++;
|
||||
|
||||
if (aService.HasSubType())
|
||||
if (aService.HasSubType() && !removing)
|
||||
{
|
||||
const char *subTypeLabel;
|
||||
uint16_t subServiceNameOffset = 0;
|
||||
@@ -1023,7 +1023,7 @@ Error Client::AppendServiceInstructions(Service &aService, Message &aMessage, In
|
||||
SuccessOrExit(error = Dns::Name::AppendPointerLabel(subServiceNameOffset, aMessage));
|
||||
}
|
||||
|
||||
// `rr` is already initialized as PTR (add or remove).
|
||||
// `rr` is already initialized as PTR.
|
||||
offset = aMessage.GetLength();
|
||||
SuccessOrExit(error = aMessage.Append(rr));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user