]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
Revert "BUG/MINOR: server: Remove FQDN requirement for using init-addr and state...
authorWilly Tarreau <w@1wt.eu>
Wed, 6 Sep 2017 12:22:45 +0000 (14:22 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 6 Sep 2017 12:22:45 +0000 (14:22 +0200)
This reverts commit 19e8aa58f7c42e602a95b4ceb4b254c424aed11c.

It causes some trouble reported by Manu :
   listen tls
     [...]
     server bla 127.0.0.1:8080

   [ALERT] 248/130258 (21960) : parsing [/etc/haproxy/test.cfg:53] : 'server bla' : no method found to resolve address '(null)'
   [ALERT] 248/130258 (21960) : Failed to initialize server(s) addr.

According to Nenad :
  "It's not a good way to fix the issue we were experiencing
   before. It will need a bigger rewrite, because the logic in
   srv_iterate_initaddr needs to be changed."

src/server.c

index 67870b8dd1b5b4509363d6b6487002a2d0565564..c80c987006219f38128870e885983447803a81d2 100644 (file)
@@ -4276,7 +4276,8 @@ int srv_init_addr(void)
                        goto srv_init_addr_next;
 
                for (srv = curproxy->srv; srv; srv = srv->next)
-                       return_code |= srv_iterate_initaddr(srv);
+                       if (srv->hostname)
+                               return_code |= srv_iterate_initaddr(srv);
 
  srv_init_addr_next:
                curproxy = curproxy->next;