Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 277681
b: refs/heads/master
c: e4ca6d9
h: refs/heads/master
i:
  277679: ca26964
v: v3
  • Loading branch information
Andrei Emeltchenko authored and Gustavo F. Padovan committed Oct 13, 2011
1 parent 3b5a152 commit 9cda28c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e37817353bf94a4e00faad78ffb8cc07f8556252
refs/heads/master: e4ca6d9854dc252e294007fc91249ce34d9a82e8
21 changes: 18 additions & 3 deletions trunk/net/bluetooth/l2cap_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,12 +566,17 @@ static inline void l2cap_send_sframe(struct l2cap_chan *chan, u16 control)
struct sk_buff *skb;
struct l2cap_hdr *lh;
struct l2cap_conn *conn = chan->conn;
int count, hlen = L2CAP_HDR_SIZE + 2;
int count, hlen;
u8 flags;

if (chan->state != BT_CONNECTED)
return;

if (test_bit(FLAG_EXT_CTRL, &chan->flags))
hlen = L2CAP_EXT_HDR_SIZE;
else
hlen = L2CAP_ENH_HDR_SIZE;

if (chan->fcs == L2CAP_FCS_CRC16)
hlen += 2;

Expand Down Expand Up @@ -1534,14 +1539,19 @@ static struct sk_buff *l2cap_create_iframe_pdu(struct l2cap_chan *chan,
struct sock *sk = chan->sk;
struct l2cap_conn *conn = chan->conn;
struct sk_buff *skb;
int err, count, hlen = L2CAP_HDR_SIZE + 2;
int err, count, hlen;
struct l2cap_hdr *lh;

BT_DBG("sk %p len %d", sk, (int)len);

if (!conn)
return ERR_PTR(-ENOTCONN);

if (test_bit(FLAG_EXT_CTRL, &chan->flags))
hlen = L2CAP_EXT_HDR_SIZE;
else
hlen = L2CAP_ENH_HDR_SIZE;

if (sdulen)
hlen += 2;

Expand Down Expand Up @@ -3098,7 +3108,12 @@ static inline void l2cap_sig_channel(struct l2cap_conn *conn,
static int l2cap_check_fcs(struct l2cap_chan *chan, struct sk_buff *skb)
{
u16 our_fcs, rcv_fcs;
int hdr_size = L2CAP_HDR_SIZE + 2;
int hdr_size;

if (test_bit(FLAG_EXT_CTRL, &chan->flags))
hdr_size = L2CAP_EXT_HDR_SIZE;
else
hdr_size = L2CAP_ENH_HDR_SIZE;

if (chan->fcs == L2CAP_FCS_CRC16) {
skb_trim(skb, skb->len - 2);
Expand Down

0 comments on commit 9cda28c

Please sign in to comment.