From 17ac6b1c1407c7ca6a99c632416378a563b2c366 Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Sun, 26 Dec 2021 08:48:06 -0800 Subject: 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 --- sys/netinet/tcp_stacks/rack_bbr_common.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sys/netinet') 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 -- cgit v1.2.3