Don't return an error for socket timeouts that are too large. Just

cap them to INT_MAX ticks instead.

PR:		kern/181416 (r254699 really)
Requested by:	bde
MFC after:	2 weeks
This commit is contained in:
John Baldwin 2013-08-29 15:59:05 +00:00
parent b9aa88b0c1
commit e289e9f2ca
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=255030

View File

@ -2698,17 +2698,12 @@ sosetopt(struct socket *so, struct sockopt *sopt)
sizeof tv);
if (error)
goto bad;
if (tv.tv_sec < 0 || tv.tv_sec > INT_MAX / hz ||
tv.tv_usec < 0 || tv.tv_usec >= 1000000) {
if (tv.tv_sec < 0 || tv.tv_usec < 0 ||
tv.tv_usec >= 1000000) {
error = EDOM;
goto bad;
}
val = tvtohz(&tv);
if (val == INT_MAX) {
error = EDOM;
goto bad;
}
switch (sopt->sopt_name) {
case SO_SNDTIMEO: