public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [Bluez-devel] [PATCH] Fix broken EVT_REMOTE_NAME_REQ_COMPLETE
@ 2007-10-25 10:06 Andreas Gaufer
  2007-10-25 23:04 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Gaufer @ 2007-10-25 10:06 UTC (permalink / raw)
  To: Bluez Devel

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

Hi Marcel,

I'm sending this bluez-libs patch for the third time now and i wonder why
you do not include it. If there is anything wrong with it please let me know
so I can learn.

Please look at 

http://article.gmane.org/gmane.linux.bluez.devel/13859
http://thread.gmane.org/gmane.linux.bluez.devel/12491

We did extensive testing and rolled that patch into production
environment already and there is another independent user (Matthias
Becker) who confirmed its usefulness.

Hoping to hear from You

Andreas Gaufer

I fully agree with RFC 1855


[-- Attachment #2: bluez-libs-3.21-EVT_REMOTE_NAME_REQ_COMPLETE.patch --]
[-- Type: application/octet-stream, Size: 799 bytes --]

diff -ur bluez-libs-3.21-orig/src/hci.c bluez-libs-3.21/src/hci.c
--- bluez-libs-3.21-orig/src/hci.c	2007-10-05 09:15:52.000000000 +0200
+++ bluez-libs-3.21/src/hci.c	2007-10-25 11:57:47.729655584 +0200
@@ -1010,6 +1010,8 @@
 	while (try--) {
 		evt_cmd_complete *cc;
 		evt_cmd_status   *cs;
+		evt_remote_name_req_complete *rn;
+		remote_name_req_cp *cp;
 
 		if (to) {
 			struct pollfd p;
@@ -1074,6 +1076,21 @@
 			memcpy(r->rparam, ptr, r->rlen);
 			goto done;
 
+		case EVT_REMOTE_NAME_REQ_COMPLETE:
+
+			if (hdr->evt != r->event)
+				break;
+
+			r->rlen = MIN(len, r->rlen);
+			memcpy(r->rparam, ptr, r->rlen);
+
+			rn = r->rparam;
+			cp = r->cparam;
+
+			if (bacmp(&rn->bdaddr,&cp->bdaddr) == 0)
+				goto done;
+			continue;
+
 		default:
 			if (hdr->evt != r->event)
 				break;

[-- Attachment #3: Type: text/plain, Size: 314 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

[-- Attachment #4: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Bluez-devel] [PATCH] Fix broken EVT_REMOTE_NAME_REQ_COMPLETE
  2007-10-25 10:06 [Bluez-devel] [PATCH] Fix broken EVT_REMOTE_NAME_REQ_COMPLETE Andreas Gaufer
@ 2007-10-25 23:04 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2007-10-25 23:04 UTC (permalink / raw)
  To: BlueZ development

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

Hi Andreas,

> I'm sending this bluez-libs patch for the third time now and i wonder why
> you do not include it. If there is anything wrong with it please let me know
> so I can learn.
> 
> Please look at 
> 
> http://article.gmane.org/gmane.linux.bluez.devel/13859
> http://thread.gmane.org/gmane.linux.bluez.devel/12491
> 
> We did extensive testing and rolled that patch into production
> environment already and there is another independent user (Matthias
> Becker) who confirmed its usefulness.

I know, but I still don't think that you should use the raw HCI socket
in this way. The D-Bus API will take care of name resolving for you in
the background and it is doing always the right thing. However I decided
to simply apply a modified patch (see attachment). You assign return
values in the case where they are not used. That makes no sense.

Regards

Marcel


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

? src/.deps
? src/.libs
? src/Makefile
? src/Makefile.in
? src/bluetooth.lo
? src/hci.lo
? src/libbluetooth.la
? src/sdp.lo
Index: src/hci.c
===================================================================
RCS file: /cvsroot/bluez/libs/src/hci.c,v
retrieving revision 1.109
diff -u -r1.109 hci.c
--- src/hci.c	5 Oct 2007 11:23:35 -0000	1.109
+++ src/hci.c	25 Oct 2007 22:59:34 -0000
@@ -1009,7 +1009,9 @@
 	try = 10;
 	while (try--) {
 		evt_cmd_complete *cc;
-		evt_cmd_status   *cs;
+		evt_cmd_status *cs;
+		evt_remote_name_req_complete *rn;
+		remote_name_req_cp *cp;
 
 		if (to) {
 			struct pollfd p;
@@ -1074,6 +1076,20 @@
 			memcpy(r->rparam, ptr, r->rlen);
 			goto done;
 
+		case EVT_REMOTE_NAME_REQ_COMPLETE:
+			if (hdr->evt != r->event)
+				break;
+
+			rn = r->rparam;
+			cp = r->cparam;
+
+			if (bacmp(&rn->bdaddr, &cp->bdaddr))
+				continue;
+
+			r->rlen = MIN(len, r->rlen);
+			memcpy(r->rparam, ptr, r->rlen);
+			goto done;
+
 		default:
 			if (hdr->evt != r->event)
 				break;

[-- Attachment #3: Type: text/plain, Size: 314 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

[-- Attachment #4: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-10-25 23:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-25 10:06 [Bluez-devel] [PATCH] Fix broken EVT_REMOTE_NAME_REQ_COMPLETE Andreas Gaufer
2007-10-25 23:04 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox