Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90646
b: refs/heads/master
c: 3654ea0
h: refs/heads/master
v: v3
  • Loading branch information
Allan Stephens authored and David S. Miller committed Apr 14, 2008
1 parent a3b7007 commit d690a1b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9673693284763417ea5edcdebc1a0c5d1dead51c
refs/heads/master: 3654ea02f2819cf8821c0acd35bc7cded5f1f2a9
9 changes: 5 additions & 4 deletions trunk/net/tipc/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
#define SS_LISTENING -1 /* socket is listening */
#define SS_READY -2 /* socket is connectionless */

#define OVERLOAD_LIMIT_BASE 5000
#define OVERLOAD_LIMIT_BASE 5000
#define CONN_TIMEOUT_DEFAULT 8000 /* default connect timeout = 8s */

struct tipc_sock {
struct sock sk;
Expand Down Expand Up @@ -170,7 +171,7 @@ static int tipc_create(struct net *net, struct socket *sock, int protocol)
}

sock_init_data(sock, sk);
sk->sk_rcvtimeo = 8 * HZ; /* default connect timeout = 8s */
sk->sk_rcvtimeo = msecs_to_jiffies(CONN_TIMEOUT_DEFAULT);

tsock = tipc_sk(sk);
port = tipc_get_port(ref);
Expand Down Expand Up @@ -1529,7 +1530,7 @@ static int setsockopt(struct socket *sock,
res = tipc_set_portunreturnable(tsock->p->ref, value);
break;
case TIPC_CONN_TIMEOUT:
sock->sk->sk_rcvtimeo = (value * HZ / 1000);
sock->sk->sk_rcvtimeo = msecs_to_jiffies(value);
break;
default:
res = -EINVAL;
Expand Down Expand Up @@ -1582,7 +1583,7 @@ static int getsockopt(struct socket *sock,
res = tipc_portunreturnable(tsock->p->ref, &value);
break;
case TIPC_CONN_TIMEOUT:
value = (sock->sk->sk_rcvtimeo * 1000) / HZ;
value = jiffies_to_msecs(sock->sk->sk_rcvtimeo);
break;
default:
res = -EINVAL;
Expand Down

0 comments on commit d690a1b

Please sign in to comment.