Skip to content

Commit

Permalink
MdnsAvahi: do not fail when instance is reinited (#18670)
Browse files Browse the repository at this point in the history
* MdnsAvahi: do not fail when avahi is restarted (seen with TE9 image in several configurations)

* MdnsAvahi: log Shutdown error as requested
  • Loading branch information
bluebin14 authored and pull[bot] committed Jul 27, 2022
1 parent 2e54c56 commit 4131119
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/platform/Linux/DnssdImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,11 @@ CHIP_ERROR MdnsAvahi::Init(DnssdAsyncReturnCallback initCallback, DnssdAsyncRetu
CHIP_ERROR error = CHIP_NO_ERROR;
int avahiError = 0;

if (Shutdown() != CHIP_NO_ERROR)
{
ChipLogError(DeviceLayer, "Shutdown() failed, continue anyway...");
}

VerifyOrExit(initCallback != nullptr, error = CHIP_ERROR_INVALID_ARGUMENT);
VerifyOrExit(errorCallback != nullptr, error = CHIP_ERROR_INVALID_ARGUMENT);
VerifyOrExit(mClient == nullptr && mGroup == nullptr, error = CHIP_ERROR_INCORRECT_STATE);
Expand Down

0 comments on commit 4131119

Please sign in to comment.