Skip to content

Commit

Permalink
[mdns-avahi] handle potential unknown Avahi states gracefully
Browse files Browse the repository at this point in the history
This change avoids `assert(false)` on `AvahiEntryGroupState` and
`AvahiClientState` `switch` statements. This prevents potential
crashes if Avahi introduces new states in future versions.
  • Loading branch information
abtink committed Feb 29, 2024
1 parent 2279c02 commit e450ab5
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/mdns/mdns_avahi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -570,10 +570,6 @@ void PublisherAvahi::HandleGroupState(AvahiEntryGroup *aGroup, AvahiEntryGroupSt
case AVAHI_ENTRY_GROUP_UNCOMMITED:
case AVAHI_ENTRY_GROUP_REGISTERING:
break;

default:
assert(false);
break;
}
}

Expand Down Expand Up @@ -696,10 +692,6 @@ void PublisherAvahi::HandleClientState(AvahiClient *aClient, AvahiClientState aS
case AVAHI_CLIENT_CONNECTING:
otbrLogInfo("Avahi client is connecting to the server");
break;

default:
assert(false);
break;
}
}

Expand Down

0 comments on commit e450ab5

Please sign in to comment.