Date: Fri, 5 Jun 2009 15:53:30 GMT From: Fang Wang <fangwang@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 163574 for review Message-ID: <200906051553.n55FrUUV011655@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 */ }; /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906051553.n55FrUUV011655>