From e1afd4fec6643685eb318da4a929ceae6c8599f8 Mon Sep 17 00:00:00 2001 From: Baptiste Assmann Date: Thu, 18 Apr 2019 16:21:13 +0200 Subject: [PATCH] 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. --- doc/configuration.txt | 5 +++++ src/proto_tcp.c | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/doc/configuration.txt b/doc/configuration.txt index c07961a25..47edf3846 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -9745,6 +9745,8 @@ tcp-request content [{if | unless} ] - sc-inc-gpc0() - sc-inc-gpc1() - sc-set-gpt0() + - set-dst + - set-dst-port - set-var() - unset-var() - silent-drop @@ -9778,6 +9780,9 @@ tcp-request content [{if | unless} ] 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. diff --git a/src/proto_tcp.c b/src/proto_tcp.c index 6a5fdefdb..d4cad223a 100644 --- a/src/proto_tcp.c +++ b/src/proto_tcp.c @@ -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 */ } }};