bump sb_timeo from short to int to allow longer timeouts.

especially when hz is high.

while i'm here, bump sb_flags to int, as suggested by
Jason Thorpe and Bill Studenmund.

ride on 2.0G.
This commit is contained in:
yamt 2004-07-01 12:42:57 +00:00
parent 0f3ce64ad4
commit fb277865d7
2 changed files with 7 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: uipc_socket.c,v 1.103 2004/05/25 04:30:32 atatat Exp $ */
/* $NetBSD: uipc_socket.c,v 1.104 2004/07/01 12:42:57 yamt Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.103 2004/05/25 04:30:32 atatat Exp $");
__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.104 2004/07/01 12:42:57 yamt Exp $");
#include "opt_sock_counters.h"
#include "opt_sosend_loan.h"
@ -1478,14 +1478,14 @@ sosetopt(struct socket *so, int level, int optname, struct mbuf *m0)
case SO_RCVTIMEO:
{
struct timeval *tv;
short val;
int val;
if (m == NULL || m->m_len < sizeof(*tv)) {
error = EINVAL;
goto bad;
}
tv = mtod(m, struct timeval *);
if (tv->tv_sec > (SHRT_MAX - tv->tv_usec / tick) / hz) {
if (tv->tv_sec > (INT_MAX - tv->tv_usec / tick) / hz) {
error = EDOM;
goto bad;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: socketvar.h,v 1.78 2004/06/05 07:14:05 yamt Exp $ */
/* $NetBSD: socketvar.h,v 1.79 2004/07/01 12:42:57 yamt Exp $ */
/*-
* Copyright (c) 1982, 1986, 1990, 1993
@ -61,8 +61,8 @@ struct sockbuf {
struct mbuf *sb_mbtail; /* the last mbuf in the chain */
struct mbuf *sb_lastrecord; /* first mbuf of last record in
socket buffer */
short sb_flags; /* flags, see below */
short sb_timeo; /* timeout for read/write */
int sb_flags; /* flags, see below */
int sb_timeo; /* timeout for read/write */
};
#ifndef SB_MAX