Skip to content

Commit 6a07c13

Browse files
committed
fix: call frang for non-tempesta socket
In `tfw_classify_conn_estab()` force Tempesta to call `frang_conn_new()` only for Tempesta's socket.
1 parent 400c2a7 commit 6a07c13

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

fw/http_limits.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,9 @@ tfw_classify_conn_close(struct sock *sk)
347347
{
348348
FrangAcc *ra = frang_acc_from_sk(sk);
349349

350+
if (unlikely(!sock_flag(sk, SOCK_TEMPESTA)))
351+
return;
352+
350353
if(ra == NULL)
351354
return;
352355

@@ -1744,7 +1747,8 @@ tfw_classifier_cleanup_inport(void)
17441747
static int
17451748
tfw_classify_conn_estab(struct sock *sk, struct sk_buff *skb)
17461749
{
1747-
if (test_bit(tfw_addr_get_sk_sport(sk), tfw_inports))
1750+
if (test_bit(tfw_addr_get_sk_sport(sk), tfw_inports)
1751+
&& sock_flag(sk, SOCK_TEMPESTA))
17481752
return frang_conn_new(sk, skb);
17491753

17501754
return T_OK;
@@ -1757,6 +1761,9 @@ tfw_classify_conn_estab(struct sock *sk, struct sk_buff *skb)
17571761
static int
17581762
tfw_classify_tcp(struct sock *sk, struct sk_buff *skb)
17591763
{
1764+
/* Just a hint. Be careful calling not only for Tempesta's socket. */
1765+
if (!sock_flag(sk, SOCK_TEMPESTA))
1766+
return T_OK;
17601767
return T_OK;
17611768
}
17621769

0 commit comments

Comments
 (0)