From: Florian Forster Date: Tue, 2 May 2017 09:21:48 +0000 (+0200) Subject: libcollectdclient: Write only metrics with the requested security level. X-Git-Tag: collectd-5.8.0~102^2~11 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=a81a7365e671cf02d88448e6c536c678a5a9d67c;p=collectd.git libcollectdclient: Write only metrics with the requested security level. --- diff --git a/src/libcollectdclient/network_parse.c b/src/libcollectdclient/network_parse.c index 83a05d4f..3a428892 100644 --- a/src/libcollectdclient/network_parse.c +++ b/src/libcollectdclient/network_parse.c @@ -529,9 +529,11 @@ static int network_parse(void *data, size_t data_size, lcc_security_level_t sl, return EINVAL; } - /* TODO(octo): skip if current_security_level < required_security_level */ + int status = 0; - int status = opts->writer(&vl); + /* Write metrics if they have the required security level. */ + if (sl >= opts->security_level) + status = opts->writer(&vl); free(vl.values); free(vl.values_types);