Hi Alexandra,

On 2/17/26 6:58 PM, Alexandra Rukomoinikova wrote:
> +static bool
> +svc_monitor_matches_health_check(const struct sbrec_service_monitor 
> *sbrec_mon,
> +                                 const char *protocol,
> +                                 const char *src_ip,
> +                                 const char *target_ip,
> +                                 uint16_t destination_port)
> +{
> +    if (strcmp(sbrec_mon->protocol, protocol) != 0) {
> +        return false;
> +    }
> +
> +    if (!strcmp(protocol, "tcp") || !strcmp(protocol, "udp")) {
> +        if (sbrec_mon->port != destination_port) {
> +            return false;
> +        }
> +    }
> +
> +    if (!strcmp(sbrec_mon->src_ip, src_ip)) {
> +        return true;
> +    }
> +
> +    if (!strcmp(sbrec_mon->ip, target_ip)) {
> +        return true;
> +    }
> +
> +    return false;
> +}


This seems wrong, and I thought I mentioned it in the previous version.

Shouldn't it be?

+    if (strcmp(sbrec_mon->src_ip, src_ip)) {
+        return false;
+    }
+
+    if (strcmp(sbrec_mon->ip, target_ip)) {
+        return false;
+    }
+
+    return true;

Or am I missing something?

Thanks,
Dumitru

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to