diff options
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/socket.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index d3f9c2d87b0d..ca6f52f392a9 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
@@ -58,7 +58,8 @@ | |||
58 | #define SS_LISTENING -1 /* socket is listening */ | 58 | #define SS_LISTENING -1 /* socket is listening */ |
59 | #define SS_READY -2 /* socket is connectionless */ | 59 | #define SS_READY -2 /* socket is connectionless */ |
60 | 60 | ||
61 | #define OVERLOAD_LIMIT_BASE 5000 | 61 | #define OVERLOAD_LIMIT_BASE 5000 |
62 | #define CONN_TIMEOUT_DEFAULT 8000 /* default connect timeout = 8s */ | ||
62 | 63 | ||
63 | struct tipc_sock { | 64 | struct tipc_sock { |
64 | struct sock sk; | 65 | struct sock sk; |
@@ -170,7 +171,7 @@ static int tipc_create(struct net *net, struct socket *sock, int protocol) | |||
170 | } | 171 | } |
171 | 172 | ||
172 | sock_init_data(sock, sk); | 173 | sock_init_data(sock, sk); |
173 | sk->sk_rcvtimeo = 8 * HZ; /* default connect timeout = 8s */ | 174 | sk->sk_rcvtimeo = msecs_to_jiffies(CONN_TIMEOUT_DEFAULT); |
174 | 175 | ||
175 | tsock = tipc_sk(sk); | 176 | tsock = tipc_sk(sk); |
176 | port = tipc_get_port(ref); | 177 | port = tipc_get_port(ref); |
@@ -1529,7 +1530,7 @@ static int setsockopt(struct socket *sock, | |||
1529 | res = tipc_set_portunreturnable(tsock->p->ref, value); | 1530 | res = tipc_set_portunreturnable(tsock->p->ref, value); |
1530 | break; | 1531 | break; |
1531 | case TIPC_CONN_TIMEOUT: | 1532 | case TIPC_CONN_TIMEOUT: |
1532 | sock->sk->sk_rcvtimeo = (value * HZ / 1000); | 1533 | sock->sk->sk_rcvtimeo = msecs_to_jiffies(value); |
1533 | break; | 1534 | break; |
1534 | default: | 1535 | default: |
1535 | res = -EINVAL; | 1536 | res = -EINVAL; |
@@ -1582,7 +1583,7 @@ static int getsockopt(struct socket *sock, | |||
1582 | res = tipc_portunreturnable(tsock->p->ref, &value); | 1583 | res = tipc_portunreturnable(tsock->p->ref, &value); |
1583 | break; | 1584 | break; |
1584 | case TIPC_CONN_TIMEOUT: | 1585 | case TIPC_CONN_TIMEOUT: |
1585 | value = (sock->sk->sk_rcvtimeo * 1000) / HZ; | 1586 | value = jiffies_to_msecs(sock->sk->sk_rcvtimeo); |
1586 | break; | 1587 | break; |
1587 | default: | 1588 | default: |
1588 | res = -EINVAL; | 1589 | res = -EINVAL; |