diff options
author | jhb <jhb@FreeBSD.org> | 2009-06-10 18:27:15 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2009-06-10 18:27:15 +0000 |
commit | d5b1c989db5b483fe2477ae36578b86fdf9c463b (patch) | |
tree | 48fe4306e8a4063e8c95c2e285ba8698ff9c0139 /sys/netinet/tcp_var.h | |
parent | 255b5eca7a5c5d2a3d7130d8cc76dd8f0122408b (diff) | |
download | FreeBSD-src-d5b1c989db5b483fe2477ae36578b86fdf9c463b.zip FreeBSD-src-d5b1c989db5b483fe2477ae36578b86fdf9c463b.tar.gz |
Change a few members of tcpcb that store cached copies of ticks to be ints
instead of unsigned longs. This fixes a few overflow edge cases on 64-bit
platforms. Specifically, if an idle connection receives a packet shortly
before 2^31 clock ticks of uptime (about 25 days with hz=1000) and the keep
alive timer fires after 2^31 clock ticks, the keep alive timer will think
that the connection has been idle for a very long time and will immediately
drop the connection instead of sending a keep alive probe.
Reviewed by: silby, gnn, lstewart
MFC after: 1 week
Diffstat (limited to 'sys/netinet/tcp_var.h')
-rw-r--r-- | sys/netinet/tcp_var.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 5568d4a..a100f23 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -139,8 +139,8 @@ struct tcpcb { u_int t_maxopd; /* mss plus options */ - u_long t_rcvtime; /* inactivity time */ - u_long t_starttime; /* time connection was established */ + int t_rcvtime; /* inactivity time */ + int t_starttime; /* time connection was established */ int t_rtttime; /* round trip time */ tcp_seq t_rtseq; /* sequence number being timed */ @@ -167,7 +167,7 @@ struct tcpcb { u_char rcv_scale; /* window scaling for recv window */ u_char request_r_scale; /* pending window scaling */ u_int32_t ts_recent; /* timestamp echo data */ - u_long ts_recent_age; /* when last updated */ + int ts_recent_age; /* when last updated */ u_int32_t ts_offset; /* our timestamp offset */ tcp_seq last_ack_sent; @@ -175,7 +175,7 @@ struct tcpcb { u_long snd_cwnd_prev; /* cwnd prior to retransmit */ u_long snd_ssthresh_prev; /* ssthresh prior to retransmit */ tcp_seq snd_recover_prev; /* snd_recover prior to retransmit */ - u_long t_badrxtwin; /* window for retransmit recovery */ + int t_badrxtwin; /* window for retransmit recovery */ u_char snd_limited; /* segments limited transmitted */ /* SACK related state */ int snd_numholes; /* number of holes seen by sender */ |