aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2021-12-26 16:48:06 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2021-12-26 16:48:06 +0000
commit17ac6b1c1407c7ca6a99c632416378a563b2c366 (patch)
tree73624c42dcb14c3b271db5143ad87265e12abb80 /sys/netinet
parent40fa3e40b5849089c5ea1e42c4318f36f227491a (diff)
downloadsrc-17ac6b1c1407c7ca6a99c632416378a563b2c366.tar.gz
src-17ac6b1c1407c7ca6a99c632416378a563b2c366.zip
bbr: drop packet synchronously in ctf_do_dropwithreset_conn()
This function is always called from tcp_do_segment() method, that can drop tcpcb and return unlocked. Reviewed by: rrs, tuexen Differential revision: https://reviews.freebsd.org/D33367
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/tcp_stacks/rack_bbr_common.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/netinet/tcp_stacks/rack_bbr_common.c b/sys/netinet/tcp_stacks/rack_bbr_common.c
index 42225dfced2f..1be426927073 100644
--- a/sys/netinet/tcp_stacks/rack_bbr_common.c
+++ b/sys/netinet/tcp_stacks/rack_bbr_common.c
@@ -969,11 +969,10 @@ ctf_do_dropwithreset_conn(struct mbuf *m, struct tcpcb *tp, struct tcphdr *th,
int32_t rstreason, int32_t tlen)
{
- if (tp->t_inpcb) {
- tcp_set_inp_to_drop(tp->t_inpcb, ETIMEDOUT);
- }
tcp_dropwithreset(m, th, tp, tlen, rstreason);
- INP_WUNLOCK(tp->t_inpcb);
+ tp = tcp_drop(tp, ETIMEDOUT);
+ if (tp)
+ INP_WUNLOCK(tp->t_inpcb);
}
uint32_t