From ee4c57309394d460bd28dd03faec03383bb2ca93 Mon Sep 17 00:00:00 2001 From: Michael Shalayeff Date: Wed, 27 Nov 2002 13:31:10 +0000 Subject: fix an underflow in socket timeout calculations. (see http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/32827). itojun@ ok --- sys/kern/uipc_socket.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys/kern') diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index cfbb7413c68..c23b7f07ee4 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_socket.c,v 1.46 2002/08/08 19:18:12 provos Exp $ */ +/* $OpenBSD: uipc_socket.c,v 1.47 2002/11/27 13:31:09 mickey Exp $ */ /* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */ /* @@ -1084,6 +1084,8 @@ sosetopt(so, level, optname, m0) goto bad; } val = tv->tv_sec * hz + tv->tv_usec / tick; + if (val == 0 && tv->tv_usec != 0) + val = 1; switch (optname) { -- cgit v1.2.3