]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolved: exit function if varlink_dispatch() returns > 0
authorLennart Poettering <lennart@poettering.net>
Wed, 28 Feb 2024 10:29:04 +0000 (11:29 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 28 Feb 2024 13:35:47 +0000 (13:35 +0000)
varlink_dispatch() returns > 0 if it already replied to the method call,
hence this is reason to return from the handler function, and not
proceed.

src/resolve/resolved-varlink.c

index a85a27867629d5865edaf3f4bc0aec9eb477fb0b..6e6e973f94a066a921fe80aa3fbabf653e0407c3 100644 (file)
@@ -1016,7 +1016,7 @@ static int vl_method_resolve_service(Varlink* link, JsonVariant* parameters, Var
                 return -EINVAL;
 
         r = varlink_dispatch(link, parameters, dispatch_table, &p);
-        if (r < 0)
+        if (r != 0)
                 return r;
 
         if (p.ifindex < 0)