[MEDIUM] add support for source interface binding

Specifying "interface <name>" after the "source" statement allows
one to bind to a specific interface for proxy<->server traffic.

This makes it possible to use multiple links to reach multiple
servers, and to force traffic to pass via an interface different
from the one the system would have chosen based on the routing
table.
This commit is contained in:
Willy Tarreau
2009-02-04 18:46:54 +01:00
parent 4e30ed73f4
commit d53f96b3f0
5 changed files with 85 additions and 31 deletions

View File

@@ -233,6 +233,8 @@ struct proxy {
#if defined(CONFIG_HAP_CTTPROXY) || defined(CONFIG_HAP_LINUX_TPROXY)
struct sockaddr_in tproxy_addr; /* non-local address we want to bind to for connect() */
#endif
int iface_len; /* bind interface name length */
char *iface_name; /* bind interface name or NULL */
struct proxy *next;
struct logsrv logsrv1, logsrv2; /* 2 syslog servers */
signed char logfac1, logfac2; /* log facility for both servers. -1 = disabled */