Date: Sun, 26 Jun 2011 15:59:48 GMT From: Catalin Nicutar <cnicutar@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 195374 for review Message-ID: <201106261559.p5QFxmPM085782@skunkworks.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@195374?ac=10 Change 195374 by cnicutar@cnicutar_cronos on 2011/06/26 15:59:08 Limit the value of the received user timeout according to min_timeout and max_timeout. Affected files ... .. //depot/projects/soc2011/cnicutar_tcputo_8/src/sys/netinet/tcp_input.c#3 edit Differences ... ==== //depot/projects/soc2011/cnicutar_tcputo_8/src/sys/netinet/tcp_input.c#3 (text+ko) ==== @@ -1091,9 +1091,13 @@ tcp_dooptions(&to, optp, optlen, TO_SYN); if (to.to_flags & TOF_UTO) { - if (tp->t_flags & TF_RCV_UTO) + if (tp->t_flags & TF_RCV_UTO) { tp->rcv_uto = (to.to_uto & 0x8000) ? (to.to_uto & 0x7FFF) * 60 : to.to_uto; + /* silently make it fit between min-max */ + tp->rcv_uto = min(V_uto_max_timeout, + max(V_uto_min_timeout, tp->rcv_uto)); + } /* * XXX-CN Using option both for send and receive. @@ -1285,9 +1289,13 @@ (thflags & TH_SYN) ? TO_SYN : 0); /* Processing received UTO. */ - if ((to.to_flags & TOF_UTO) && (tp->t_flags & TF_RCV_UTO)) + if ((to.to_flags & TOF_UTO) && (tp->t_flags & TF_RCV_UTO)) { + /* convert to seconds if granularity is set */ tp->rcv_uto = (to.to_uto & 0x8000) ? (to.to_uto & 0x7FFF) * 60 : to.to_uto; + tp->rcv_uto = min(V_uto_max_timeout, + max(V_uto_min_timeout, tp->rcv_uto)); + } /* * If echoed timestamp is later than the current time,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106261559.p5QFxmPM085782>