Skip to contentSkip to conversation

bluetooth-alsa: Connection fix for kernel >= 2.6.30

PATCH Per-Henrik Lundblom 1 participant 1 message Jan 2, 2012 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hi,

After trying to get bluetooth-alsa working on Ubuntu 11.10 (kernel 3.0.0) I realized that the struct sockaddr_l2 struct was changed in kernel 2.6.30 to include a l2_cid variable. This variable is of course not set in the a2dpd code which results in a socket connect() call returning -EINVAL.

Simple fix is to memset struct before use. Patch is attached. Unfortunately I don't have any idea where to send the patch, hope this list isn't totally wrong.

/PH

--
Per-Henrik Lundblom epost: [email protected]
telefon: 0733-20 71 26 hemsida: www.whatever.nu

Index: a2dpd_tools.c
===================================================================
RCS file: /cvsroot/bluetooth-alsa/plugz/alsa-plugins/a2dpd/a2dpd_tools.c,v retrieving revision 1.8

a2dpd_tools.c +1 -0
diff -u -r1.8 a2dpd_tools.c
@@ -212,6 +212,7 @@
 	{
 		struct sockaddr_l2 sa;
 
+                memset(&sa, 0, sizeof(sa));
 		// create L2CAP connection
 		session->sock = socket(PF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_L2CAP);
 		session->local = 0;