mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 14:21:25 +02:00
MINOR: config: do not test an inherited socket again
Since previous patch we know that a successfully bound fd@XXX socket is returned as its own protocol family from str2sa_range() and not as AF_CUST_EXISTING_FD anymore o we don't need to check for that case in str2listener().
This commit is contained in:
parent
6edc722093
commit
804f11fdf8
@ -133,25 +133,7 @@ int str2listener(char *str, struct proxy *curproxy, struct bind_conf *bind_conf,
|
|||||||
if (!ss2)
|
if (!ss2)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if (ss2->ss_family == AF_CUST_EXISTING_FD) {
|
if (ss2->ss_family == AF_CUST_SOCKPAIR) {
|
||||||
socklen_t addr_len;
|
|
||||||
|
|
||||||
/* We want to attach to an already bound fd whose number
|
|
||||||
* is in the addr part of ss2 when cast to sockaddr_in.
|
|
||||||
* Note that by definition there is a single listener.
|
|
||||||
* We still have to determine the address family to
|
|
||||||
* register the correct protocol.
|
|
||||||
*/
|
|
||||||
fd = ((struct sockaddr_in *)ss2)->sin_addr.s_addr;
|
|
||||||
addr_len = sizeof(*ss2);
|
|
||||||
if (getsockname(fd, (struct sockaddr *)ss2, &addr_len) == -1) {
|
|
||||||
memprintf(err, "cannot use file descriptor '%d' : %s.\n", fd, strerror(errno));
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
port = end = get_host_port(ss2);
|
|
||||||
|
|
||||||
} else if (ss2->ss_family == AF_CUST_SOCKPAIR) {
|
|
||||||
socklen_t addr_len;
|
socklen_t addr_len;
|
||||||
|
|
||||||
fd = ((struct sockaddr_in *)ss2)->sin_addr.s_addr;
|
fd = ((struct sockaddr_in *)ss2)->sin_addr.s_addr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user