MINOR: proto_tcp: tcp-request content: enable set-dst and set-dst-var

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.
This commit is contained in:
Baptiste Assmann 2019-04-18 16:21:13 +02:00 committed by Willy Tarreau
parent ffe30f708f
commit e1afd4fec6
2 changed files with 10 additions and 3 deletions

View File

@ -9745,6 +9745,8 @@ tcp-request content <action> [{if | unless} <condition>]
- sc-inc-gpc0(<sc-id>) - sc-inc-gpc0(<sc-id>)
- sc-inc-gpc1(<sc-id>) - sc-inc-gpc1(<sc-id>)
- sc-set-gpt0(<sc-id>) <int> - sc-set-gpt0(<sc-id>) <int>
- set-dst <expr>
- set-dst-port <expr>
- set-var(<var-name>) <expr> - set-var(<var-name>) <expr>
- unset-var(<var-name>) - unset-var(<var-name>)
- silent-drop - 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 wait until the inspect delay expires when the data to be tracked is not yet
available. 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 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 declared inline. For "tcp-request session" rules, only session-level
variables can be used, without any layer7 contents. variables can be used, without any layer7 contents.

View File

@ -1986,29 +1986,31 @@ static struct srv_kw_list srv_kws = { "TCP", { }, {
INITCALL1(STG_REGISTER, srv_register_keywords, &srv_kws); INITCALL1(STG_REGISTER, srv_register_keywords, &srv_kws);
static struct action_kw_list tcp_req_conn_actions = {ILH, { 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", tcp_parse_set_src_dst },
{ "set-src-port", tcp_parse_set_src_dst }, { "set-src-port", tcp_parse_set_src_dst },
{ "set-dst" , tcp_parse_set_src_dst }, { "set-dst" , tcp_parse_set_src_dst },
{ "set-dst-port", tcp_parse_set_src_dst }, { "set-dst-port", tcp_parse_set_src_dst },
{ "silent-drop", tcp_parse_silent_drop },
{ /* END */ } { /* END */ }
}}; }};
INITCALL1(STG_REGISTER, tcp_req_conn_keywords_register, &tcp_req_conn_actions); INITCALL1(STG_REGISTER, tcp_req_conn_keywords_register, &tcp_req_conn_actions);
static struct action_kw_list tcp_req_sess_actions = {ILH, { 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", tcp_parse_set_src_dst },
{ "set-src-port", tcp_parse_set_src_dst }, { "set-src-port", tcp_parse_set_src_dst },
{ "set-dst" , tcp_parse_set_src_dst }, { "set-dst" , tcp_parse_set_src_dst },
{ "set-dst-port", tcp_parse_set_src_dst }, { "set-dst-port", tcp_parse_set_src_dst },
{ "silent-drop", tcp_parse_silent_drop },
{ /* END */ } { /* END */ }
}}; }};
INITCALL1(STG_REGISTER, tcp_req_sess_keywords_register, &tcp_req_sess_actions); INITCALL1(STG_REGISTER, tcp_req_sess_keywords_register, &tcp_req_sess_actions);
static struct action_kw_list tcp_req_cont_actions = {ILH, { 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 */ } { /* END */ }
}}; }};