Fix packet analyzer replacement.

Also reworking the existing test, which was pretty odd/broken.
This commit is contained in:
Robin Sommer 2024-04-30 11:30:35 +02:00
parent 3a469b3619
commit ccfeffaf2b
No known key found for this signature in database
GPG key ID: D8187293B3FFE5D0
5 changed files with 26 additions and 26 deletions

View file

@ -42,7 +42,7 @@ void Dispatcher::Register(uint32_t identifier, AnalyzerPtr analyzer) {
}
int64_t index = identifier - lowest_identifier;
if ( table[index] != nullptr )
if ( table[index] != nullptr && table[index] != analyzer )
reporter->Info("Overwriting packet analyzer mapping %#8" PRIx64 " => %s with %s", index + lowest_identifier,
table[index]->GetAnalyzerName(), analyzer->GetAnalyzerName());
table[index] = std::move(analyzer);