]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
src/ovs_stats.c: Importing changes from `main`.
authorFlorian Forster <octo@collectd.org>
Tue, 19 Dec 2023 08:51:55 +0000 (09:51 +0100)
committerFlorian Forster <octo@collectd.org>
Mon, 22 Jan 2024 20:22:04 +0000 (21:22 +0100)
Changes:
dcd22696ebeb4556ed172b0253b90d38bebfc742 use derive_t instead of int inside ovs_stats_get_port_stat_value
91a642385e2d068d106aa5c307de968f8b33add5 bug#3924 fix

src/ovs_stats.c

index e22e851e2545974d6f24325953ad038b3e2bdba1..aafc84f093e51430077559fe4ade1d527de0780b 100644 (file)
@@ -371,12 +371,12 @@ static void ovs_stats_submit_interfaces(port_list_t *port) {
   }
 }
 
-static int ovs_stats_get_port_stat_value(port_list_t *port,
-                                         iface_counter index) {
+static derive_t ovs_stats_get_port_stat_value(port_list_t *port,
+                                              iface_counter index) {
   if (port == NULL)
     return 0;
 
-  int value = 0;
+  derive_t value = 0;
 
   for (interface_list_t *iface = port->iface; iface != NULL;
        iface = iface->next) {
@@ -1090,8 +1090,8 @@ static int ovs_stats_del_interface(const char *uuid) {
   interface_list_t *prev_iface = NULL;
 
   for (interface_list_t *iface = port->iface; iface != NULL;
-       iface = port->iface) {
-    if (strncmp(iface->iface_uuid, uuid, strlen(iface->iface_uuid))) {
+       iface = iface->next) {
+    if (!strncmp(iface->iface_uuid, uuid, strlen(iface->iface_uuid))) {
 
       interface_list_t *del = iface;