aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2024-11-21 00:32:29 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2024-11-21 00:37:18 +0000
commit2944a888eabffd4db47dde0f30aa0f5061460f56 (patch)
tree9882a244357437aa4d15d553d23af402f6520923
parentb80c06cc0af4a913778d6014eae6ce30e1ec2c68 (diff)
tcp: remove so != NULL check
In the modern FreeBSD network stack a socket outlives its tcpcb.
-rw-r--r--sys/netinet/tcp_subr.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index c30b3aaf76c3..4baeb6f8f2d2 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -2469,10 +2469,8 @@ tcp_discardcb(struct tcpcb *tp)
* XXXRRS: Updating must be after the stack fini() since
* that may be converting some internal representation of
* say srtt etc into the general one used by other stacks.
- * Lets also at least protect against the so being NULL
- * as RW stated below.
*/
- if ((tp->t_rttupdated >= 4) && (so != NULL)) {
+ if (tp->t_rttupdated >= 4) {
struct hc_metrics_lite metrics;
uint32_t ssthresh;
@@ -2482,9 +2480,6 @@ tcp_discardcb(struct tcpcb *tp)
* are satisfied. This gives us better new start value
* for the congestion avoidance for new connections.
* ssthresh is only set if packet loss occurred on a session.
- *
- * XXXRW: 'so' may be NULL here, and/or socket buffer may be
- * being torn down. Ideally this code would not use 'so'.
*/
ssthresh = tp->snd_ssthresh;
if (ssthresh != 0 && ssthresh < so->so_snd.sb_hiwat / 2) {