From: Mytnyk, VolodymyrX Date: Tue, 11 Oct 2016 10:46:24 +0000 (+0100) Subject: OVS events: Fix multiple interface config issue X-Git-Tag: collectd-5.8.0~256^2~7 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=02baaed92d2d69207170a6dc727326e22f743575;p=collectd.git OVS events: Fix multiple interface config issue If multiple interfaces are configured, only last one will be monitored (notifications aren't sent for all others). Change-Id: Ica918ef0557747d84677db739a64698d3756a675 Signed-off-by: Mytnyk, VolodymyrX --- diff --git a/src/ovs_events.c b/src/ovs_events.c index 7521b280..ce5254da 100644 --- a/src/ovs_events.c +++ b/src/ovs_events.c @@ -120,14 +120,15 @@ static int ovs_events_ctx_unlock() { */ static int ovs_events_config_iface_exists(const char *ifname) { if (ovs_events_ctx.config.ifaces == NULL) - return -1; + return (-1); /* check if given interface exists */ for (ovs_events_iface_list_t *iface = ovs_events_ctx.config.ifaces; iface; iface = iface->next) - return (strcmp(ifname, iface->name) == 0); + if (strcmp(ifname, iface->name) == 0) + return (1); - return 0; + return (0); } /* Get OVS DB select parameter request based on rfc7047,