libcollectdclient: Write only metrics with the requested security level.
authorFlorian Forster <octo@collectd.org>
Tue, 2 May 2017 09:21:48 +0000 (11:21 +0200)
committerFlorian Forster <octo@collectd.org>
Tue, 2 May 2017 09:21:48 +0000 (11:21 +0200)
src/libcollectdclient/network_parse.c

index 83a05d4..3a42889 100644 (file)
@@ -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);