mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-01 00:18:15 +01:00
getsockopt(s, SOL_SOCKET, SO_SNDTIMEO, ...) would construct the returned
timeval incorrectly, truncating the usec part. Obtained from: Stevens vol. 2 p. 548
This commit is contained in:
parent
41f82abe5a
commit
5f540404a8
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)uipc_socket.c 8.3 (Berkeley) 4/15/94
|
||||
* $Id: uipc_socket.c,v 1.7 1995/02/06 02:22:12 davidg Exp $
|
||||
* $Id: uipc_socket.c,v 1.8 1995/02/07 02:01:14 wollman Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -1029,7 +1029,7 @@ sogetopt(so, level, optname, mp)
|
||||
m->m_len = sizeof(struct timeval);
|
||||
mtod(m, struct timeval *)->tv_sec = val / hz;
|
||||
mtod(m, struct timeval *)->tv_usec =
|
||||
(val % hz) / tick;
|
||||
(val % hz) * tick;
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user