diff options
author | Eric Dumazet <edumazet@google.com> | 2024-10-10 19:48:14 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-10-15 02:39:36 +0200 |
commit | bc43a3c83cad46a27d6e3bf869acdd926bbe79ad (patch) | |
tree | 1d6be7db5eac427b79b700e66340db97b86fb1e5 /net/sched | |
parent | net: add TIME_WAIT logic to sk_to_full_sk() (diff) | |
download | linux-bc43a3c83cad46a27d6e3bf869acdd926bbe79ad.tar.xz linux-bc43a3c83cad46a27d6e3bf869acdd926bbe79ad.zip |
net_sched: sch_fq: prepare for TIME_WAIT sockets
TCP stack is not attaching skb to TIME_WAIT sockets yet,
but we would like to allow this in the future.
Add sk_listener_or_tw() helper to detect the three states
that FQ needs to take care.
Like NEW_SYN_RECV, TIME_WAIT are not full sockets and
do not contain sk->sk_pacing_status, sk->sk_pacing_rate.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Brian Vazquez <brianvv@google.com>
Link: https://patch.msgid.link/20241010174817.1543642-3-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/sched')
-rw-r--r-- | net/sched/sch_fq.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/sched/sch_fq.c b/net/sched/sch_fq.c index aeabf45c9200..a97638bef6da 100644 --- a/net/sched/sch_fq.c +++ b/net/sched/sch_fq.c @@ -362,8 +362,9 @@ static struct fq_flow *fq_classify(struct Qdisc *sch, struct sk_buff *skb, * 3) We do not want to rate limit them (eg SYNFLOOD attack), * especially if the listener set SO_MAX_PACING_RATE * 4) We pretend they are orphaned + * TCP can also associate TIME_WAIT sockets with RST or ACK packets. */ - if (!sk || sk_listener(sk)) { + if (!sk || sk_listener_or_tw(sk)) { unsigned long hash = skb_get_hash(skb) & q->orphan_mask; /* By forcing low order bit to 1, we make sure to not |