Fix addr/string type confusion in Broker::peers()

Broker::NetworkInfo$address is of type string. The Broker::peers() BiF treated
it as an address, which caused ZVal's type validation to flag a
mismatch and abort.

Includes a small tweak to the broker.unpeer test that makes it invoke
Broker::peers(), which breaks in absence of the fix.
This commit is contained in:
Christian Kreibich 2021-08-18 15:16:58 -07:00
parent b28fc77054
commit fa38d81a7b
3 changed files with 4 additions and 2 deletions

View file

@ -43,6 +43,7 @@ event zeek_init()
event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string)
{
print fmt("peered, now %d peer(s)", |Broker::peers()|);
schedule 2secs { print_something(1) };
schedule 4secs { unpeer(endpoint) };
}