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_usrreq.c | |
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_usrreq.c')
-rw-r--r-- | sys/netinet/tcp_usrreq.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 089ef1f..e787eed 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1823,7 +1823,7 @@ db_print_tcpcb(struct tcpcb *tp, const char *name, int indent) tp->snd_recover); db_print_indent(indent); - db_printf("t_maxopd: %u t_rcvtime: %lu t_startime: %lu\n", + db_printf("t_maxopd: %u t_rcvtime: %u t_startime: %u\n", tp->t_maxopd, tp->t_rcvtime, tp->t_starttime); db_print_indent(indent); @@ -1854,7 +1854,7 @@ db_print_tcpcb(struct tcpcb *tp, const char *name, int indent) tp->snd_scale, tp->rcv_scale, tp->request_r_scale); db_print_indent(indent); - db_printf("ts_recent: %u ts_recent_age: %lu\n", + db_printf("ts_recent: %u ts_recent_age: %u\n", tp->ts_recent, tp->ts_recent_age); db_print_indent(indent); @@ -1863,7 +1863,7 @@ db_print_tcpcb(struct tcpcb *tp, const char *name, int indent) db_print_indent(indent); db_printf("snd_ssthresh_prev: %lu snd_recover_prev: 0x%08x " - "t_badrxtwin: %lu\n", tp->snd_ssthresh_prev, + "t_badrxtwin: %u\n", tp->snd_ssthresh_prev, tp->snd_recover_prev, tp->t_badrxtwin); db_print_indent(indent); |