From owner-p4-projects@FreeBSD.ORG Sat Aug 20 09:41:33 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EF81D1065670; Sat, 20 Aug 2011 09:41:32 +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 A9B83106566B for ; Sat, 20 Aug 2011 09:41:32 +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 7EB0B8FC08 for ; Sat, 20 Aug 2011 09:41:32 +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 p7K9fWbC003628 for ; Sat, 20 Aug 2011 09:41:32 GMT (envelope-from cnicutar@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p7K9fWw3003625 for perforce@freebsd.org; Sat, 20 Aug 2011 09:41:32 GMT (envelope-from cnicutar@freebsd.org) Date: Sat, 20 Aug 2011 09:41:32 GMT Message-Id: <201108200941.p7K9fWw3003625@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 197905 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: Sat, 20 Aug 2011 09:41:33 -0000 http://p4web.freebsd.org/@@197905?ac=10 Change 197905 by cnicutar@cnicutar_cronos on 2011/08/20 09:40:36 Take uto_enable into account when handling connections. Affected files ... .. //depot/projects/soc2011/cnicutar_tcputo_9/src/sys/netinet/tcp_input.c#4 edit .. //depot/projects/soc2011/cnicutar_tcputo_9/src/sys/netinet/tcp_usrreq.c#4 edit .. //depot/projects/soc2011/cnicutar_tcputo_9/src/sys/netinet/tcp_var.h#7 edit Differences ... ==== //depot/projects/soc2011/cnicutar_tcputo_9/src/sys/netinet/tcp_input.c#4 (text+ko) ==== @@ -3196,8 +3196,6 @@ case TCPOPT_UTO: if (optlen != TCPOLEN_UTO) continue; - if (!V_uto_enable) - continue; to->to_flags |= TOF_UTO; bcopy((char *)cp + 2, (char *)&to->to_uto, sizeof(to->to_uto)); ==== //depot/projects/soc2011/cnicutar_tcputo_9/src/sys/netinet/tcp_usrreq.c#4 (text+ko) ==== @@ -1330,7 +1330,8 @@ return (error); INP_WLOCK_RECHECK(inp); - if (optval == 0) { + /* Silently turn it off if !V_uto_enable. */ + if (!V_uto_enable || optval <= 0) { /* Disable sending the option. */ tp->t_flags &= ~TF_SND_UTO; tp->snd_uto = 0; @@ -1353,16 +1354,18 @@ return (error); INP_WLOCK_RECHECK(inp); - if (optval <= 0) + if (!V_uto_enable || optval <= 0) /* This connection will ignore suggestions. */ tp->t_flags &= ~TF_RCV_UTO; else { tp->t_flags |= TF_RCV_UTO; /* * If optval > 1, we'll use it as the max - * acceptable suggestion. + * acceptable suggestion (or silently truncate + * it to V_uto_max_timeout). */ - tp->max_uto = (optval > 1) ? + tp->max_uto = (optval > 1 && + optval < V_uto_max_timeout) ? optval : V_uto_max_timeout; } INP_WUNLOCK(inp); ==== //depot/projects/soc2011/cnicutar_tcputo_9/src/sys/netinet/tcp_var.h#7 (text+ko) ==== @@ -262,8 +262,8 @@ #define BYTES_THIS_ACK(tp, th) (th->th_ack - tp->snd_una) -#define USING_UTO(tp) (tp)->snd_uto || \ - (((tp)->t_flags & TF_RCV_UTO) && (tp)->rcv_uto) +#define USING_UTO(tp) V_uto_enable && ((tp)->snd_uto || \ + (((tp)->t_flags & TF_RCV_UTO) && (tp)->rcv_uto)) #define UTO_VALUE(to) ((to).to_uto & UTO_MINS) ? \ ((to).to_uto & ~(UTO_MINS)) * 60 : (to).to_uto