Commit 6fffe657 authored by David S. Miller's avatar David S. Miller

[NET]: Fix SO_{RCV,SND}TIMEO getsockopt handling.

A microsecond is 1 millionth of a second not
1 thousandth of a second.

Noticed by Markus Mottl <markus@oefai.at>
Signed-off-by: default avatarDavid S. Miller <davem@redhat.com>
parent 98daa247
...@@ -523,7 +523,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname, ...@@ -523,7 +523,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
v.tm.tv_usec = 0; v.tm.tv_usec = 0;
} else { } else {
v.tm.tv_sec = sk->sk_rcvtimeo / HZ; v.tm.tv_sec = sk->sk_rcvtimeo / HZ;
v.tm.tv_usec = ((sk->sk_rcvtimeo % HZ) * 1000) / HZ; v.tm.tv_usec = ((sk->sk_rcvtimeo % HZ) * 1000000) / HZ;
} }
break; break;
...@@ -534,7 +534,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname, ...@@ -534,7 +534,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
v.tm.tv_usec = 0; v.tm.tv_usec = 0;
} else { } else {
v.tm.tv_sec = sk->sk_sndtimeo / HZ; v.tm.tv_sec = sk->sk_sndtimeo / HZ;
v.tm.tv_usec = ((sk->sk_sndtimeo % HZ) * 1000) / HZ; v.tm.tv_usec = ((sk->sk_sndtimeo % HZ) * 1000000) / HZ;
} }
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment