[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bluetooth-dev] Bug in hci.c?



Hi all,

I think I have discovered a bug in the file 'hci.c' in the function
'reject_connection_request'. Take a look at the following snippet, shouldn't
the assignment to c_pkt.ocf be REJECT_CONNECTION_REQUEST?

s32
reject_connection_request(u8 bd_addr[], u32 reason)
{
  u32 c = 0;

  D_CTRL("reject_connection_request: to bd_addr %x %x %x %x %x
%x\n",bd_addr[0],bd_addr[1],bd_addr[2],bd_addr[3],bd_addr[4],bd_addr[5]);

  c_pkt.type = CMD_PKT;
  c_pkt.ocf = ACCEPT_CONNECTION_REQUEST;
  c_pkt.ogf = HCI_LC;

  memcpy(c_pkt.data, bd_addr, 6);
  c += 6;
  c_pkt.data[c] = reason;
  c += 1;
  c_pkt.len = c;

  return send_cmd((u8*) &c_pkt ,c_pkt.len + CMD_HDR_LEN + HCI_HDR_LEN);
}


Cheers,

Ulf Söderberg
Possio AB