Skip to content

Commit

Permalink
Bluetooth: Fix sk_sndtimeo initialization for L2CAP socket
Browse files Browse the repository at this point in the history
sk_sndtime value should be specified in jiffies thus initial value
needs to be converted from miliseconds. Otherwise this timeout is
unreliable when CONFIG_HZ is not set to 1000.

Signed-off-by: Andrzej Kaczmarek <[email protected]>
Acked-by: Marcel Holtmann <[email protected]>
Signed-off-by: Johan Hedberg <[email protected]>
  • Loading branch information
Andrzej Kaczmarek authored and Johan Hedberg committed Feb 15, 2012
1 parent 4aa832c commit a637525
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/bluetooth/l2cap_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ static struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, int p
INIT_LIST_HEAD(&bt_sk(sk)->accept_q);

sk->sk_destruct = l2cap_sock_destruct;
sk->sk_sndtimeo = L2CAP_CONN_TIMEOUT;
sk->sk_sndtimeo = msecs_to_jiffies(L2CAP_CONN_TIMEOUT);

sock_reset_flag(sk, SOCK_ZAPPED);

Expand Down

0 comments on commit a637525

Please sign in to comment.