]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: proto_tcp: tcp-request content: enable set-dst and set-dst-var
authorBaptiste Assmann <bedis9@gmail.com>
Thu, 18 Apr 2019 14:21:13 +0000 (16:21 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 19 Apr 2019 13:50:06 +0000 (15:50 +0200)
The set-dst and set dst-var are available at both 'tcp-request
connection' and 'http-request' but not at the layer in the middle.
This patch fixes this miss and enables both set-dst and set-dst-var at
'tcp-request content' layer.

doc/configuration.txt
src/proto_tcp.c

index c07961a258d40773b380182e2b6bac7dc34e616f..47edf38468a813d94d52bd841e316f4ab29bcf8b 100644 (file)
@@ -9745,6 +9745,8 @@ tcp-request content <action> [{if | unless} <condition>]
     - sc-inc-gpc0(<sc-id>)
     - sc-inc-gpc1(<sc-id>)
     - sc-set-gpt0(<sc-id>) <int>
+    - set-dst <expr>
+    - set-dst-port <expr>
     - set-var(<var-name>) <expr>
     - unset-var(<var-name>)
     - silent-drop
@@ -9778,6 +9780,9 @@ tcp-request content <action> [{if | unless} <condition>]
   wait until the inspect delay expires when the data to be tracked is not yet
   available.
 
+  The "set-dst" and "set-dst-port" are used to set respectively the destination
+  IP and port. More information on how to use it at "http-request set-dst".
+
   The "set-var" is used to set the content of a variable. The variable is
   declared inline. For "tcp-request session" rules, only session-level
   variables can be used, without any layer7 contents.
index 6a5fdefdbf0608b21300cfe79d3094542f8aa6d7..d4cad223a730036d2d780c4a3589ba95a03ec3b0 100644 (file)
@@ -1986,29 +1986,31 @@ static struct srv_kw_list srv_kws = { "TCP", { }, {
 INITCALL1(STG_REGISTER, srv_register_keywords, &srv_kws);
 
 static struct action_kw_list tcp_req_conn_actions = {ILH, {
-       { "silent-drop",  tcp_parse_silent_drop },
        { "set-src",      tcp_parse_set_src_dst },
        { "set-src-port", tcp_parse_set_src_dst },
        { "set-dst"     , tcp_parse_set_src_dst },
        { "set-dst-port", tcp_parse_set_src_dst },
+       { "silent-drop",  tcp_parse_silent_drop },
        { /* END */ }
 }};
 
 INITCALL1(STG_REGISTER, tcp_req_conn_keywords_register, &tcp_req_conn_actions);
 
 static struct action_kw_list tcp_req_sess_actions = {ILH, {
-       { "silent-drop",  tcp_parse_silent_drop },
        { "set-src",      tcp_parse_set_src_dst },
        { "set-src-port", tcp_parse_set_src_dst },
        { "set-dst"     , tcp_parse_set_src_dst },
        { "set-dst-port", tcp_parse_set_src_dst },
+       { "silent-drop",  tcp_parse_silent_drop },
        { /* END */ }
 }};
 
 INITCALL1(STG_REGISTER, tcp_req_sess_keywords_register, &tcp_req_sess_actions);
 
 static struct action_kw_list tcp_req_cont_actions = {ILH, {
-       { "silent-drop", tcp_parse_silent_drop },
+       { "set-dst"     , tcp_parse_set_src_dst },
+       { "set-dst-port", tcp_parse_set_src_dst },
+       { "silent-drop",  tcp_parse_silent_drop },
        { /* END */ }
 }};