From owner-p4-projects@FreeBSD.ORG Sun Mar 22 22:23:59 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D1BBF1065688; Sun, 22 Mar 2009 22:23:58 +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 8EA49106567E for ; Sun, 22 Mar 2009 22:23:58 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 7D23B8FC15 for ; Sun, 22 Mar 2009 22:23:58 +0000 (UTC) (envelope-from andre@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 n2MMNwVG033078 for ; Sun, 22 Mar 2009 22:23:58 GMT (envelope-from andre@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n2MMNwDl033076 for perforce@freebsd.org; Sun, 22 Mar 2009 22:23:58 GMT (envelope-from andre@freebsd.org) Date: Sun, 22 Mar 2009 22:23:58 GMT Message-Id: <200903222223.n2MMNwDl033076@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to andre@freebsd.org using -f From: Andre Oppermann To: Perforce Change Reviews Cc: Subject: PERFORCE change 159642 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: Sun, 22 Mar 2009 22:24:00 -0000 http://perforce.freebsd.org/chv.cgi?CH=159642 Change 159642 by andre@andre_t61 on 2009/03/22 22:23:33 Add tcp_win and tcp_ts types for more safety Affected files ... .. //depot/projects/tcp_new/netinet/tcp.h#3 edit .. //depot/projects/tcp_new/netinet/tcp_input.c#9 edit .. //depot/projects/tcp_new/netinet/tcp_var.h#6 edit Differences ... ==== //depot/projects/tcp_new/netinet/tcp.h#3 (text+ko) ==== @@ -38,6 +38,8 @@ #if __BSD_VISIBLE typedef u_int32_t tcp_seq; +typedef u_int32_t tcp_win; +typedef u_int32_t tcp_ts; #define tcp6_seq tcp_seq /* for KAME src sync over BSD*'s */ #define tcp6hdr tcphdr /* for KAME src sync over BSD*'s */ ==== //depot/projects/tcp_new/netinet/tcp_input.c#9 (text+ko) ==== @@ -2490,7 +2490,7 @@ int acked, int tlen, int sacked) { int rtt; - int tick = tcp_ticks; + tcp_ts tick = tcp_ticks; INP_LOCK_ASSERT(tp->t_inpcb); KASSERT(tp != NULL && th != NULL && to != NULL, ==== //depot/projects/tcp_new/netinet/tcp_var.h#6 (text+ko) ==== @@ -295,16 +295,16 @@ * options in tcp_addoptions. */ struct tcpopt { - u_long to_flags; /* which options are present */ + u_int to_flags; /* which options are present */ #define TOF_MSS 0x0001 /* maximum segment size */ #define TOF_SCALE 0x0002 /* window scaling */ #define TOF_SACKPERM 0x0004 /* SACK permitted */ #define TOF_TS 0x0010 /* timestamp */ #define TOF_SIGNATURE 0x0040 /* TCP-MD5 signature option (RFC2385) */ #define TOF_SACK 0x0080 /* Peer sent SACK option */ -#define TOF_MAXOPT 0x0100 - u_int32_t to_tsval; /* new timestamp */ - u_int32_t to_tsecr; /* reflected timestamp */ +#define TOF_MAXOPT 0x0100 /* highest option shift one */ + tcp_ts to_tsval; /* new timestamp */ + tcp_ts to_tsecr; /* reflected timestamp */ u_int16_t to_mss; /* maximum segment size */ u_int8_t to_wscale; /* window scaling */ u_int8_t to_nsacks; /* number of SACK blocks */