public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: "Collin R. Mulliner" <collin@betaversion.net>
Cc: BlueZ Mailing List <bluez-devel@lists.sourceforge.net>
Subject: Re: [Bluez-devel] L2CAP raw socket patch
Date: Sun, 22 Feb 2004 16:31:30 +0100	[thread overview]
Message-ID: <1077463890.2716.53.camel@pegasus> (raw)
In-Reply-To: <20040211000722.2368d2e9.collin@betaversion.net>

[-- Attachment #1: Type: text/plain, Size: 367 bytes --]

Hi Collin,

> so what do you all think about the RAW socket patch, does it make sense
> putting it into the official tree?

the original code was even wrong. If a SKB contains two or more commands
or responses the SKB will be put more than once to the raw socket. I am
going to apply the attached patch and hope we don't get a performance
decrease.

Regards

Marcel


[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 836 bytes --]

===== net/bluetooth/l2cap.c 1.36 vs edited =====
--- 1.36/net/bluetooth/l2cap.c	Wed Jan 14 21:56:53 2004
+++ edited/net/bluetooth/l2cap.c	Sun Feb 22 16:22:51 2004
@@ -1629,6 +1629,8 @@
 	struct l2cap_cmd_hdr cmd;
 	int err = 0;
 
+	l2cap_raw_recv(conn, skb);
+
 	while (len >= L2CAP_CMD_HDR_SIZE) {
 		memcpy(&cmd, data, L2CAP_CMD_HDR_SIZE);
 		data += L2CAP_CMD_HDR_SIZE;
@@ -1670,7 +1672,6 @@
 
 		case L2CAP_COMMAND_REJ:
 			/* FIXME: We should process this */
-			l2cap_raw_recv(conn, skb);
 			break;
 
 		case L2CAP_ECHO_REQ:
@@ -1680,11 +1681,10 @@
 		case L2CAP_ECHO_RSP:
 		case L2CAP_INFO_REQ:
 		case L2CAP_INFO_RSP:
-			l2cap_raw_recv(conn, skb);
 			break;
 
 		default:
-			BT_ERR("Uknown signaling command 0x%2.2x", cmd.code);
+			BT_ERR("Unknown signaling command 0x%2.2x", cmd.code);
 			err = -EINVAL;
 			break;
 		}

      reply	other threads:[~2004-02-22 15:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-10 11:49 [Bluez-devel] L2CAP raw socket patch Collin R. Mulliner
2004-02-10 22:16 ` Marcel Holtmann
     [not found]   ` <20040210232330.4cf4935d.collin@betaversion.net>
2004-02-10 22:32     ` Marcel Holtmann
2004-02-10 23:07       ` Collin R. Mulliner
2004-02-22 15:31         ` Marcel Holtmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1077463890.2716.53.camel@pegasus \
    --to=marcel@holtmann.org \
    --cc=bluez-devel@lists.sourceforge.net \
    --cc=collin@betaversion.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox