Closed JINwonLEE closed 1 year ago
I'm using tcpcopy & intercept in mirroring tcp packets to target server.
Furthermore I navigated source code of tcpcopy on interest. However I saw some curious points in the source code below.
// src/tcpcopy/tc_session.c:2288 seq = ntohl(tcp->seq); diff = tc_time() - s->create_time; if (diff < TCP_MS_TIMEOUT && (s->sm.state & SYN_SENT)) { if (before(seq, s->req_syn_seq)) { tc_log_debug1(LOG_INFO, 0, "timeout pack,p:%u", ntohs(s->src_port)); return; } }
In this source code, variable diff has scaling with seconds(s). However TCP_MS_TIMEOUT has value(6000) with milliseconds.
The two different variables are comparing without matching unit(seconds vs milliseconds).
As I understand, this logic would be adding log and return after timeout(6seconds) when syn sent to target server.
If there is anything misunderstanding, please advice me.
Thanks.
It is really a mistake when using TCP_MS_TIMEOUT.
Oh, I see recent commit now. TCP_INTERFERENCE_PREVENTION_TIMEOUT is set to 10 minutes. Thanks.
I'm using tcpcopy & intercept in mirroring tcp packets to target server.
Furthermore I navigated source code of tcpcopy on interest. However I saw some curious points in the source code below.
In this source code, variable diff has scaling with seconds(s). However TCP_MS_TIMEOUT has value(6000) with milliseconds.
The two different variables are comparing without matching unit(seconds vs milliseconds).
As I understand, this logic would be adding log and return after timeout(6seconds) when syn sent to target server.
If there is anything misunderstanding, please advice me.
Thanks.