From owner-p4-projects@FreeBSD.ORG Sun Jun 26 15:59:48 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A33111065675; Sun, 26 Jun 2011 15:59:48 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 661B4106564A for ; Sun, 26 Jun 2011 15:59:48 +0000 (UTC) (envelope-from cnicutar@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 54EA68FC17 for ; Sun, 26 Jun 2011 15:59:48 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id p5QFxmxS085785 for ; Sun, 26 Jun 2011 15:59:48 GMT (envelope-from cnicutar@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p5QFxmPM085782 for perforce@freebsd.org; Sun, 26 Jun 2011 15:59:48 GMT (envelope-from cnicutar@freebsd.org) Date: Sun, 26 Jun 2011 15:59:48 GMT Message-Id: <201106261559.p5QFxmPM085782@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to cnicutar@freebsd.org using -f From: Catalin Nicutar To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 195374 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jun 2011 15:59:48 -0000 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,