Deprecate global Val pointers in NetVar.h

All of these have fairly niche uses, so better maintained as
lookup/static closer to the usage site.
This commit is contained in:
Jon Siwek 2020-05-12 00:01:40 -07:00
parent c0986f0739
commit d34b24e776
13 changed files with 83 additions and 49 deletions

View file

@ -7,6 +7,7 @@
#include <openssl/evp.h>
#include "NetVar.h"
#include "Var.h"
#include "digest.h"
#include "highwayhash/sip_hash.h"
@ -22,10 +23,12 @@ Hasher::seed_t Hasher::MakeSeed(const void* data, size_t size)
assert(sizeof(tmpseed) == 16);
static auto global_hash_seed = zeek::lookup_val<StringVal>("global_hash_seed");
if ( data )
hash_update(ctx, data, size);
else if ( global_hash_seed && global_hash_seed->Len() > 0 )
else if ( global_hash_seed->Len() > 0 )
hash_update(ctx, global_hash_seed->Bytes(), global_hash_seed->Len());
else