diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2014-07-01 05:07:23 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-07-03 11:42:52 -0400 |
commit | bf19d51b768ceeccab12f932cac73b60b1d20bab (patch) | |
tree | 560bc05fbc7f2b6e5eedf690f8f893750b9950af /net | |
parent | 26b0f4e2f9d022193039a72db09c048b9ae93459 (diff) |
Bluetooth: Allow L2CAP getpeername() for BT_CONFIG state
We have all the necessary remote information for getpeername() when we
are in the BT_CONFIG state so this should be allowed. This is
particularly important for LE sockets where changing the security level
will temporarily move the socket into BT_CONFIG state.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/l2cap_sock.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index bf72886de6ef..9bb4d1b3a483 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c | |||
@@ -361,7 +361,8 @@ static int l2cap_sock_getname(struct socket *sock, struct sockaddr *addr, | |||
361 | BT_DBG("sock %p, sk %p", sock, sk); | 361 | BT_DBG("sock %p, sk %p", sock, sk); |
362 | 362 | ||
363 | if (peer && sk->sk_state != BT_CONNECTED && | 363 | if (peer && sk->sk_state != BT_CONNECTED && |
364 | sk->sk_state != BT_CONNECT && sk->sk_state != BT_CONNECT2) | 364 | sk->sk_state != BT_CONNECT && sk->sk_state != BT_CONNECT2 && |
365 | sk->sk_state != BT_CONFIG) | ||
365 | return -ENOTCONN; | 366 | return -ENOTCONN; |
366 | 367 | ||
367 | memset(la, 0, sizeof(struct sockaddr_l2)); | 368 | memset(la, 0, sizeof(struct sockaddr_l2)); |