From owner-p4-projects@FreeBSD.ORG Fri Jun 5 15:53:31 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4178C1065670; Fri, 5 Jun 2009 15:53:31 +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 01D01106564A for ; Fri, 5 Jun 2009 15:53:31 +0000 (UTC) (envelope-from fangwang@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id C99FB8FC0C for ; Fri, 5 Jun 2009 15:53:30 +0000 (UTC) (envelope-from fangwang@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n55FrUZb011658 for ; Fri, 5 Jun 2009 15:53:30 GMT (envelope-from fangwang@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n55FrUUV011655 for perforce@freebsd.org; Fri, 5 Jun 2009 15:53:30 GMT (envelope-from fangwang@FreeBSD.org) Date: Fri, 5 Jun 2009 15:53:30 GMT Message-Id: <200906051553.n55FrUUV011655@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to fangwang@FreeBSD.org using -f From: Fang Wang To: Perforce Change Reviews Cc: Subject: PERFORCE change 163574 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 15:53:32 -0000 http://perforce.freebsd.org/chv.cgi?CH=163574 Change 163574 by fangwang@fangwang_utobsd on 2009/06/05 15:52:44 Add UTO support in tcp_dooptions. Modify some mistakes. Affected files ... .. //depot/projects/soc2009/tcputo/src/sys/netinet/tcp_input.c#2 edit .. //depot/projects/soc2009/tcputo/src/sys/netinet/tcp_output.c#4 edit .. //depot/projects/soc2009/tcputo/src/sys/netinet/tcp_var.h#7 edit Differences ... ==== //depot/projects/soc2009/tcputo/src/sys/netinet/tcp_input.c#2 (text+ko) ==== @@ -2943,6 +2943,16 @@ to->to_sacks = cp + 2; TCPSTAT_INC(tcps_sack_rcv_blocks); break; + case TCPOPT_UTO: + unsigned short uto_load; + if (optlen != TCPOLEN_UTO) + continue; + to->to_flags |= TOF_UTO; + bcopy((char *)cp + 2, + (char *)&uto_load, sizeof(uto_load)); + uto_load = ntohs(uto_load); + to->to_granularity = uto_load >> 15; + to->to_uto = uto_load - ((unsigned short)to->to_granularity << 15)); default: continue; } ==== //depot/projects/soc2009/tcputo/src/sys/netinet/tcp_output.c#4 (text+ko) ==== @@ -1446,7 +1446,7 @@ } case TOF_UTO: { - unsigned short uto_load = (unsigned short)to->to_granularity; + unsigned short uto_load = (unsigned short)to->to_granularity << 15; uto_load += to->to_uto; if (TCP_MAXOLEN - optlen < TCPOLEN_UTO) continue; ==== //depot/projects/soc2009/tcputo/src/sys/netinet/tcp_var.h#7 (text+ko) ==== @@ -196,10 +196,10 @@ u_int snd_uto; /* send user timeout value, in seconds */ u_char rcv_uto_granularity:1; /* received user timeout granularity */ u_char snd_uto_granularity:1; /* received user timeout granularity */ - u_char uto_enable:1; /* flag controls whether the UTO option is enabled for a connection */ - u_char uto_changeable:1; /* flag that controls whether USER_TIMEOUT may be changed based on t_rcvuto */ - u_char uto_impl:1; /* flag that controls whelther implement user timeout */ - u_int t_impl_uto; /* implemented user timeout value (ticks) */ + u_char uto_enable:1; /* flag controls whether the UTO option is enabled */ + u_char uto_changeable:1; /* flag that controls whether USER_TIMEOUT may be changed based on rcv_uto */ + u_char uto_impl:1; /* flag that controls whether implement user timeout */ + u_int t_impl_uto; /* implemented user timeout */ }; /*