From: Scott Jordan Date: Tue, 9 May 2023 20:38:55 +0000 (-0400) Subject: datasets: bugfix to load ip types from yaml X-Git-Tag: suricata-7.0.0-rc2~181 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F8852%2Fhead;p=thirdparty%2Fsuricata.git datasets: bugfix to load ip types from yaml --- diff --git a/src/datasets.c b/src/datasets.c index 5fc9797a35..c4a1fcefdf 100644 --- a/src/datasets.c +++ b/src/datasets.c @@ -949,6 +949,28 @@ int DatasetsInit(void) } SCLogDebug("dataset %s: id %u type %s", set_name, dset->id, set_type->val); dset->from_yaml = true; + + } else if (strcmp(set_type->val, "ipv4") == 0) { + Dataset *dset = DatasetGet(set_name, DATASET_TYPE_IPV4, save, load, + memcap > 0 ? memcap : default_memcap, + hashsize > 0 ? hashsize : default_hashsize); + if (dset == NULL) { + FatalErrorOnInit("failed to setup dataset for %s", set_name); + continue; + } + SCLogDebug("dataset %s: id %u type %s", set_name, dset->id, set_type->val); + dset->from_yaml = true; + + } else if (strcmp(set_type->val, "ip") == 0) { + Dataset *dset = DatasetGet(set_name, DATASET_TYPE_IPV6, save, load, + memcap > 0 ? memcap : default_memcap, + hashsize > 0 ? hashsize : default_hashsize); + if (dset == NULL) { + FatalErrorOnInit("failed to setup dataset for %s", set_name); + continue; + } + SCLogDebug("dataset %s: id %u type %s", set_name, dset->id, set_type->val); + dset->from_yaml = true; } list_pos++;