Bluetooth: L2CAP: Fix sending wrong CID for LE Credits

The CID should be taken from rx endpoint not tx endpoint as the credits
are in fact updated in rx.credits.

Change-Id: I43aed2a08b6fd978244c02c43640a3226d897e45
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Luiz Augusto von Dentz 2015-11-12 12:12:54 +02:00 committed by Anas Nashif
commit 0ba6b93793

View file

@ -730,7 +730,7 @@ static void l2cap_chan_update_credits(struct bt_l2cap_chan *chan)
hdr->len = sys_cpu_to_le16(sizeof(*ev));
ev = net_buf_add(buf, sizeof(*ev));
ev->cid = sys_cpu_to_le16(chan->tx.cid);
ev->cid = sys_cpu_to_le16(chan->rx.cid);
ev->credits = sys_cpu_to_le16(credits);
bt_l2cap_send(chan->conn, BT_L2CAP_CID_LE_SIG, buf);