]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: resolvers: return the correct value in resolvers_finalize_config()
authorWilliam Lallemand <wlallemand@haproxy.org>
Wed, 24 Aug 2022 07:58:31 +0000 (09:58 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Wed, 24 Aug 2022 08:11:17 +0000 (10:11 +0200)
Patch c31577f ("MEDIUM: resolvers: continue startup if network is
unavailable") was not working correctly. Indeed
resolvers_finalize_config() was returning a ERR type, but a postparser
is supposed to return 0 or 1.

The return value was never right, however it was only a problem since c31577f.

Must be backported in every stable branch.

src/resolvers.c

index f325f39c3ff825dadbb013628cfc119d3dcb43c6..2124df7bb3cd1f0b33d5d8ded99d04063028cbcf 100644 (file)
@@ -2481,7 +2481,7 @@ static void resolvers_deinit(void)
 
 /* Finalizes the DNS configuration by allocating required resources and checking
  * live parameters.
- * Returns 0 on success, ERR_* flags otherwise.
+ * Returns 0 on success, 1 on error.
  */
 static int resolvers_finalize_config(void)
 {
@@ -2594,11 +2594,11 @@ static int resolvers_finalize_config(void)
                goto err;
 
        leave_resolver_code();
-       return err_code;
+       return 0;
   err:
        leave_resolver_code();
        resolvers_deinit();
-       return err_code;
+       return 1;
 
 }