MINOR: standard: Disable ip resolution during the runtime

The function str2net runs DNS resolution if valid ip cannot be parsed.
The DNS function used is the standard function of the libc and it
performs asynchronous request.

The asynchronous request is not compatible with the haproxy
archictecture.

str2net() is used during the runtime throught the "socket".

This patch remove the DNS resolution during the runtime.
This commit is contained in:
Thierry FOURNIER
2014-02-11 15:23:04 +01:00
committed by Willy Tarreau
parent 94580c9f52
commit fc7ac7b89c
4 changed files with 10 additions and 6 deletions

View File

@@ -248,7 +248,7 @@ int cidr2dotted(int cidr, struct in_addr *mask);
* is optionnal and either in the dotted or CIDR notation.
* Note: "addr" can also be a hostname. Returns 1 if OK, 0 if error.
*/
int str2net(const char *str, struct in_addr *addr, struct in_addr *mask);
int str2net(const char *str, int resolve, struct in_addr *addr, struct in_addr *mask);
/*
* converts <str> to two struct in6_addr* which must be pre-allocated.