Bluetooth: Add L2CAP channel to skb private data
authorGustavo Padovan <gustavo.padovan@collabora.co.uk>
Mon, 21 Oct 2013 20:22:24 +0000 (18:22 -0200)
committerMarcel Holtmann <marcel@holtmann.org>
Mon, 21 Oct 2013 20:50:55 +0000 (13:50 -0700)
Adding the channel to the skb private data makes possible to us know which
channel the skb we have came from.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
include/net/bluetooth/bluetooth.h
net/bluetooth/l2cap_sock.c

index bf2ddffdae2d226d0727656cb1f98ef0eab8f94a..a707a0209df44fcf502d74a08b2895daaac39b01 100644 (file)
@@ -282,6 +282,7 @@ struct bt_skb_cb {
        __u8 incoming;
        __u16 expect;
        __u8 force_active;
+       struct l2cap_chan *chan;
        struct l2cap_ctrl control;
        struct hci_req_ctrl req;
        bdaddr_t bdaddr;
index a159b0e05202fb0940f35a33ed3247ee7e2325e6..cba3162dc33db973ad950d77b99393d598e6389b 100644 (file)
@@ -1174,6 +1174,8 @@ static struct sk_buff *l2cap_sock_alloc_skb_cb(struct l2cap_chan *chan,
        if (!skb)
                return ERR_PTR(err);
 
+       bt_cb(skb)->chan = chan;
+
        return skb;
 }