aboutsummaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2013-10-13 08:50:41 -0700
committerMister Oyster <oysterized@gmail.com>2017-04-11 10:59:08 +0200
commitd9b0f3472f74a8cc5f7fd2f81fe3451e25fe3f9a (patch)
tree2c0c0be646f43bb423adffc5261dd52148583453 /include/net
parent465bede53aa29c9a0eb474ff39ad7a774da95002 (diff)
Bluetooth: Return the correct address type for L2CAP sockets
The L2CAP sockets can use BR/EDR public, LE public and LE random addresses for various combinations of source and destination devices. So make sure that getsockname(), getpeername() and accept() return the correct address type. For this the address type of the source and destination is stored with the L2CAP channel information. The stored address type is not the one specific for the HCI protocol. It is the address type used for the L2CAP sockets and the management interface. The underlying HCI connections store the HCI address type. If needed, it gets converted to the socket address type. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Kamal Negi <kamaln@codeaurora.org>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/bluetooth/l2cap.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index fb94cf13c..909e678c2 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -442,7 +442,12 @@ struct l2cap_chan {
__u8 state;
+ bdaddr_t dst;
+ __u8 dst_type;
+ bdaddr_t src;
+ __u8 src_type;
__le16 psm;
+ __le16 sport;
__u16 dcid;
__u16 scid;
@@ -453,8 +458,6 @@ struct l2cap_chan {
__u8 chan_type;
__u8 chan_policy;
- __le16 sport;
-
__u8 sec_level;
__u8 ident;