From d57724fd46dfe52ff1fa6d11f9b070333de3ac6f Mon Sep 17 00:00:00 2001 From: Patrick Kelsey Date: Fri, 17 Jul 2015 17:36:33 +0000 Subject: [PATCH] Check TCP timestamp option flag so that the automatic receive buffer scaling code does not use an uninitialized timestamp echo reply value from the stack when timestamps are not enabled. Differential Revision: https://reviews.freebsd.org/D3060 Reviewed by: hiren Approved by: jmallett (mentor) MFC after: 3 days Sponsored by: Norse Corp, Inc. --- sys/netinet/tcp_input.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index aaf227c50a2..9454a6565b0 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1856,6 +1856,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, * the buffer to better manage the socket buffer resources. */ if (V_tcp_do_autorcvbuf && + (to.to_flags & TOF_TS) && to.to_tsecr && (so->so_rcv.sb_flags & SB_AUTOSIZE)) { if (TSTMP_GT(to.to_tsecr, tp->rfbuf_ts) &&