diff --git a/include/types/proxy.h b/include/types/proxy.h index 13b5f2a52..cc2311781 100644 --- a/include/types/proxy.h +++ b/include/types/proxy.h @@ -96,10 +96,11 @@ #define PR_O_ABRT_CLOSE 0x00800000 /* immediately abort request when client closes */ /* TPXY: exclusive values */ -#define PR_O_TPXY_ADDR 0x02000000 /* bind to this non-local address when connect()ing */ -#define PR_O_TPXY_CIP 0x04000000 /* bind to the client's IP address when connect()ing */ -#define PR_O_TPXY_CLI 0x06000000 /* bind to the client's IP+port when connect()ing */ -#define PR_O_TPXY_MASK 0x06000000 /* bind to a non-local address when connect()ing */ +#define PR_O_TPXY_ADDR 0x01000000 /* bind to this non-local address when connect()ing */ +#define PR_O_TPXY_CIP 0x02000000 /* bind to the client's IP address when connect()ing */ +#define PR_O_TPXY_CLI 0x03000000 /* bind to the client's IP+port when connect()ing */ +#define PR_O_TPXY_DYN 0x04000000 /* bind to a dynamically computed non-local address */ +#define PR_O_TPXY_MASK 0x07000000 /* bind to a non-local address when connect()ing */ #define PR_O_SERVER_CLO 0x08000000 /* option http-server-close */ #define PR_O_CONTSTATS 0x10000000 /* continous counters */ diff --git a/include/types/server.h b/include/types/server.h index ac94460dc..bf3d6b01e 100644 --- a/include/types/server.h +++ b/include/types/server.h @@ -51,7 +51,8 @@ #define SRV_TPROXY_ADDR 0x0100 /* bind to this non-local address to reach this server */ #define SRV_TPROXY_CIP 0x0200 /* bind to the client's IP address to reach this server */ #define SRV_TPROXY_CLI 0x0300 /* bind to the client's IP+port to reach this server */ -#define SRV_TPROXY_MASK 0x0300 /* bind to a non-local address to reach this server */ +#define SRV_TPROXY_DYN 0x0400 /* bind to a dynamically computed non-local address */ +#define SRV_TPROXY_MASK 0x0700 /* bind to a non-local address to reach this server */ /* function which act on servers need to return various errors */ #define SRV_STATUS_OK 0 /* everything is OK. */ diff --git a/src/proto_tcp.c b/src/proto_tcp.c index 50ab08170..6494db7a5 100644 --- a/src/proto_tcp.c +++ b/src/proto_tcp.c @@ -254,6 +254,7 @@ int tcpv4_connect_server(struct stream_interface *si, flags = 3; break; case SRV_TPROXY_CIP: + case SRV_TPROXY_DYN: flags = 1; break; } @@ -326,6 +327,7 @@ int tcpv4_connect_server(struct stream_interface *si, flags = 3; break; case PR_O_TPXY_CIP: + case PR_O_TPXY_DYN: flags = 1; break; }