svn commit: r281210 - in head: lib/libbluetooth lib/libsdp usr.bin/bluetooth/bthost usr.bin/bluetooth/btsockstat usr.bin/bluetooth/rfcomm_sppd usr.sbin/bluetooth/bthidcontrol usr.sbin/bluetooth/bth...

Takanori Watanabe takawata at FreeBSD.org
Tue Apr 7 16:48:51 UTC 2015


Author: takawata
Date: Tue Apr  7 16:48:23 2015
New Revision: 281210
URL: https://svnweb.freebsd.org/changeset/base/281210

Log:
  Check l2cap socket initialisation and define L2CAP_SOCKET_CHECKED
  This will fix build.

Modified:
  head/lib/libbluetooth/bluetooth.c
  head/lib/libbluetooth/dev.c
  head/lib/libbluetooth/hci.c
  head/lib/libsdp/search.c
  head/lib/libsdp/service.c
  head/lib/libsdp/session.c
  head/lib/libsdp/util.c
  head/usr.bin/bluetooth/bthost/bthost.c
  head/usr.bin/bluetooth/btsockstat/btsockstat.c
  head/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sdp.c
  head/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c
  head/usr.sbin/bluetooth/bthidcontrol/bthidcontrol.c
  head/usr.sbin/bluetooth/bthidcontrol/hid.c
  head/usr.sbin/bluetooth/bthidcontrol/sdp.c
  head/usr.sbin/bluetooth/bthidd/bthidd.c
  head/usr.sbin/bluetooth/bthidd/client.c
  head/usr.sbin/bluetooth/bthidd/hid.c
  head/usr.sbin/bluetooth/bthidd/kbd.c
  head/usr.sbin/bluetooth/bthidd/lexer.l
  head/usr.sbin/bluetooth/bthidd/parser.y
  head/usr.sbin/bluetooth/bthidd/server.c
  head/usr.sbin/bluetooth/bthidd/session.c
  head/usr.sbin/bluetooth/btpand/bnep.c
  head/usr.sbin/bluetooth/btpand/btpand.c
  head/usr.sbin/bluetooth/btpand/channel.c
  head/usr.sbin/bluetooth/btpand/client.c
  head/usr.sbin/bluetooth/btpand/event.c
  head/usr.sbin/bluetooth/btpand/packet.c
  head/usr.sbin/bluetooth/btpand/sdp.c
  head/usr.sbin/bluetooth/btpand/server.c
  head/usr.sbin/bluetooth/btpand/tap.c
  head/usr.sbin/bluetooth/hccontrol/hccontrol.c
  head/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c
  head/usr.sbin/bluetooth/hccontrol/info.c
  head/usr.sbin/bluetooth/hccontrol/link_control.c
  head/usr.sbin/bluetooth/hccontrol/link_policy.c
  head/usr.sbin/bluetooth/hccontrol/node.c
  head/usr.sbin/bluetooth/hccontrol/util.c
  head/usr.sbin/bluetooth/hcsecd/hcsecd.c
  head/usr.sbin/bluetooth/hcsecd/parser.y
  head/usr.sbin/bluetooth/l2control/l2cap.c
  head/usr.sbin/bluetooth/l2control/l2control.c
  head/usr.sbin/bluetooth/l2ping/l2ping.c
  head/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.c
  head/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.c
  head/usr.sbin/bluetooth/sdpcontrol/search.c
  head/usr.sbin/bluetooth/sdpd/bgd.c
  head/usr.sbin/bluetooth/sdpd/dun.c
  head/usr.sbin/bluetooth/sdpd/ftrn.c
  head/usr.sbin/bluetooth/sdpd/gn.c
  head/usr.sbin/bluetooth/sdpd/irmc.c
  head/usr.sbin/bluetooth/sdpd/irmc_command.c
  head/usr.sbin/bluetooth/sdpd/lan.c
  head/usr.sbin/bluetooth/sdpd/main.c
  head/usr.sbin/bluetooth/sdpd/nap.c
  head/usr.sbin/bluetooth/sdpd/opush.c
  head/usr.sbin/bluetooth/sdpd/panu.c
  head/usr.sbin/bluetooth/sdpd/profile.c
  head/usr.sbin/bluetooth/sdpd/provider.c
  head/usr.sbin/bluetooth/sdpd/sar.c
  head/usr.sbin/bluetooth/sdpd/scr.c
  head/usr.sbin/bluetooth/sdpd/sd.c
  head/usr.sbin/bluetooth/sdpd/server.c
  head/usr.sbin/bluetooth/sdpd/sp.c
  head/usr.sbin/bluetooth/sdpd/srr.c
  head/usr.sbin/bluetooth/sdpd/ssar.c
  head/usr.sbin/bluetooth/sdpd/ssr.c
  head/usr.sbin/bluetooth/sdpd/sur.c
  head/usr.sbin/bluetooth/sdpd/uuid.c

Modified: head/lib/libbluetooth/bluetooth.c
==============================================================================
--- head/lib/libbluetooth/bluetooth.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/lib/libbluetooth/bluetooth.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -30,7 +30,7 @@
  * $Id: bluetooth.c,v 1.3 2003/05/20 23:04:30 max Exp $
  * $FreeBSD$
  */
-
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <stdio.h>
 #include <stdlib.h>

Modified: head/lib/libbluetooth/dev.c
==============================================================================
--- head/lib/libbluetooth/dev.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/lib/libbluetooth/dev.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -30,6 +30,7 @@
  * $FreeBSD$
  */
 
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <stdio.h>
 #include <string.h>

Modified: head/lib/libbluetooth/hci.c
==============================================================================
--- head/lib/libbluetooth/hci.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/lib/libbluetooth/hci.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -31,6 +31,7 @@
  */
 
 #include <assert.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <inttypes.h>
 #include <stdio.h>

Modified: head/lib/libsdp/search.c
==============================================================================
--- head/lib/libsdp/search.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/lib/libsdp/search.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -32,6 +32,7 @@
 #include <sys/uio.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <errno.h>
 #include <stdio.h>

Modified: head/lib/libsdp/service.c
==============================================================================
--- head/lib/libsdp/service.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/lib/libsdp/service.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -32,6 +32,7 @@
 #include <sys/uio.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <errno.h>
 #include <string.h>

Modified: head/lib/libsdp/session.c
==============================================================================
--- head/lib/libsdp/session.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/lib/libsdp/session.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -28,7 +28,7 @@
  * $Id: session.c,v 1.2 2003/09/04 22:12:13 max Exp $
  * $FreeBSD$
  */
-
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <errno.h>
 #include <stdlib.h>
@@ -62,6 +62,9 @@ sdp_open(bdaddr_t const *l, bdaddr_t con
 	sa.l2cap_len = sizeof(sa);
 	sa.l2cap_family = AF_BLUETOOTH;
 	sa.l2cap_psm = 0;
+	sa.l2cap_cid = 0;
+	sa.l2cap_bdaddr_type = BDADDR_BREDR;
+	
 	memcpy(&sa.l2cap_bdaddr, l, sizeof(sa.l2cap_bdaddr));
 	if (bind(ss->s, (struct sockaddr *) &sa, sizeof(sa)) < 0) {
 		ss->error = errno;

Modified: head/lib/libsdp/util.c
==============================================================================
--- head/lib/libsdp/util.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/lib/libsdp/util.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -30,6 +30,7 @@
  */
 
 #include <netinet/in.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <stdio.h>
 #include <sdp.h>

Modified: head/usr.bin/bluetooth/bthost/bthost.c
==============================================================================
--- head/usr.bin/bluetooth/bthost/bthost.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.bin/bluetooth/bthost/bthost.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -29,6 +29,7 @@
  * $FreeBSD$
  */
 
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <stdio.h>
 #include <stdlib.h>

Modified: head/usr.bin/bluetooth/btsockstat/btsockstat.c
==============================================================================
--- head/usr.bin/bluetooth/btsockstat/btsockstat.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.bin/bluetooth/btsockstat/btsockstat.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -39,6 +39,7 @@
 
 #include <net/if.h>
 
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <err.h>
 #include <fcntl.h>

Modified: head/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sdp.c
==============================================================================
--- head/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sdp.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sdp.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -28,7 +28,7 @@
  * $Id: rfcomm_sdp.c,v 1.1 2003/09/07 18:15:55 max Exp $
  * $FreeBSD$
  */
-
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <errno.h>
 #include <sdp.h>

Modified: head/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c
==============================================================================
--- head/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -33,6 +33,7 @@
 
 #include <sys/stat.h>
 #include <sys/types.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <ctype.h>
 #include <err.h>

Modified: head/usr.sbin/bluetooth/bthidcontrol/bthidcontrol.c
==============================================================================
--- head/usr.sbin/bluetooth/bthidcontrol/bthidcontrol.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/bthidcontrol/bthidcontrol.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -31,6 +31,7 @@
 
 #include <sys/queue.h>
 #include <assert.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <err.h>
 #include <errno.h>

Modified: head/usr.sbin/bluetooth/bthidcontrol/hid.c
==============================================================================
--- head/usr.sbin/bluetooth/bthidcontrol/hid.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/bthidcontrol/hid.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -30,6 +30,7 @@
  */
 
 #include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <dev/usb/usb.h>
 #include <dev/usb/usbhid.h>

Modified: head/usr.sbin/bluetooth/bthidcontrol/sdp.c
==============================================================================
--- head/usr.sbin/bluetooth/bthidcontrol/sdp.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/bthidcontrol/sdp.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -30,6 +30,7 @@
  */
 
 #include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <dev/usb/usb.h>
 #include <dev/usb/usbhid.h>

Modified: head/usr.sbin/bluetooth/bthidd/bthidd.c
==============================================================================
--- head/usr.sbin/bluetooth/bthidd/bthidd.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/bthidd/bthidd.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -34,6 +34,7 @@
 #include <sys/time.h>
 #include <sys/queue.h>
 #include <assert.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <err.h>
 #include <errno.h>

Modified: head/usr.sbin/bluetooth/bthidd/client.c
==============================================================================
--- head/usr.sbin/bluetooth/bthidd/client.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/bthidd/client.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -33,6 +33,7 @@
 
 #include <sys/queue.h>
 #include <assert.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <errno.h>
 #include <fcntl.h>
@@ -236,7 +237,9 @@ client_socket(bdaddr_p bdaddr, uint16_t 
 	l2addr.l2cap_family = AF_BLUETOOTH;
 	memset(&l2addr.l2cap_bdaddr, 0, sizeof(l2addr.l2cap_bdaddr));
 	l2addr.l2cap_psm = 0;
-
+	l2addr.l2cap_bdaddr_type = BDADDR_BREDR;
+	l2addr.l2cap_cid = 0;
+	
 	if (bind(s, (struct sockaddr *) &l2addr, sizeof(l2addr)) < 0) {
 		close(s);
 		return (-1);

Modified: head/usr.sbin/bluetooth/bthidd/hid.c
==============================================================================
--- head/usr.sbin/bluetooth/bthidd/hid.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/bthidd/hid.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -35,6 +35,7 @@
 #include <sys/mouse.h>
 #include <sys/queue.h>
 #include <assert.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <dev/usb/usb.h>
 #include <dev/usb/usbhid.h>

Modified: head/usr.sbin/bluetooth/bthidd/kbd.c
==============================================================================
--- head/usr.sbin/bluetooth/bthidd/kbd.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/bthidd/kbd.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -37,6 +37,7 @@
 #include <sys/queue.h>
 #include <sys/wait.h>
 #include <assert.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <dev/usb/usb.h>
 #include <dev/usb/usbhid.h>

Modified: head/usr.sbin/bluetooth/bthidd/lexer.l
==============================================================================
--- head/usr.sbin/bluetooth/bthidd/lexer.l	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/bthidd/lexer.l	Tue Apr  7 16:48:23 2015	(r281210)
@@ -31,7 +31,7 @@
  * $Id: lexer.l,v 1.3 2006/09/07 21:06:53 max Exp $
  * $FreeBSD$
  */
-
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <stdlib.h>
 #include "parser.h"

Modified: head/usr.sbin/bluetooth/bthidd/parser.y
==============================================================================
--- head/usr.sbin/bluetooth/bthidd/parser.y	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/bthidd/parser.y	Tue Apr  7 16:48:23 2015	(r281210)
@@ -33,6 +33,7 @@
  */
 
 #include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <dev/usb/usb.h>
 #include <dev/usb/usbhid.h>

Modified: head/usr.sbin/bluetooth/bthidd/server.c
==============================================================================
--- head/usr.sbin/bluetooth/bthidd/server.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/bthidd/server.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -33,6 +33,7 @@
 
 #include <sys/queue.h>
 #include <assert.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <dev/vkbd/vkbd_var.h>
 #include <errno.h>
@@ -90,7 +91,9 @@ server_init(bthid_server_p srv)
 	l2addr.l2cap_family = AF_BLUETOOTH;
 	memcpy(&l2addr.l2cap_bdaddr, &srv->bdaddr, sizeof(l2addr.l2cap_bdaddr));
 	l2addr.l2cap_psm = htole16(0x11);
-
+	l2addr.l2cap_bdaddr_type = BDADDR_BREDR;
+	l2addr.l2cap_cid = 0;
+	
 	if (bind(srv->ctrl, (struct sockaddr *) &l2addr, sizeof(l2addr)) < 0) {
 		syslog(LOG_ERR, "Could not bind control L2CAP socket. " \
 			"%s (%d)", strerror(errno), errno);

Modified: head/usr.sbin/bluetooth/bthidd/session.c
==============================================================================
--- head/usr.sbin/bluetooth/bthidd/session.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/bthidd/session.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -33,6 +33,7 @@
 
 #include <sys/queue.h>
 #include <assert.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <errno.h>
 #include <fcntl.h>

Modified: head/usr.sbin/bluetooth/btpand/bnep.c
==============================================================================
--- head/usr.sbin/bluetooth/btpand/bnep.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/btpand/bnep.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -31,6 +31,7 @@
 __RCSID("$NetBSD: bnep.c,v 1.1 2008/08/17 13:20:57 plunky Exp $");
 
 #include <sys/uio.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <sdp.h>
 #include <stdarg.h>

Modified: head/usr.sbin/bluetooth/btpand/btpand.c
==============================================================================
--- head/usr.sbin/bluetooth/btpand/btpand.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/btpand/btpand.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -33,6 +33,7 @@ __RCSID("$NetBSD: btpand.c,v 1.1 2008/08
 
 #include <sys/wait.h>
 
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <err.h>
 #include <fcntl.h>

Modified: head/usr.sbin/bluetooth/btpand/channel.c
==============================================================================
--- head/usr.sbin/bluetooth/btpand/channel.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/btpand/channel.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -35,7 +35,7 @@ __RCSID("$NetBSD: channel.c,v 1.1 2008/0
 
 #include <libutil.h>
 #include <unistd.h>
-
+#define L2CAP_SOCKET_CHECKED
 #include "btpand.h"
 
 static struct chlist	channel_list;

Modified: head/usr.sbin/bluetooth/btpand/client.c
==============================================================================
--- head/usr.sbin/bluetooth/btpand/client.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/btpand/client.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -30,6 +30,7 @@
 #include <sys/cdefs.h>
 __RCSID("$NetBSD: client.c,v 1.2 2008/12/06 20:01:14 plunky Exp $");
 
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <errno.h>
 #include <sdp.h>
@@ -65,6 +66,9 @@ client_init(void)
 	memset(&sa, 0, sizeof(sa));
 	sa.l2cap_family = AF_BLUETOOTH;
 	sa.l2cap_len = sizeof(sa);
+	sa.l2cap_bdaddr_type = BDADDR_BREDR;
+	sa.l2cap_cid = 0;
+	 
 	bdaddr_copy(&sa.l2cap_bdaddr, &local_bdaddr);
 	if (bind(fd, (struct sockaddr *)&sa, sizeof(sa)) == -1) {
 		log_err("Could not bind client socket: %m");

Modified: head/usr.sbin/bluetooth/btpand/event.c
==============================================================================
--- head/usr.sbin/bluetooth/btpand/event.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/btpand/event.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -45,6 +45,7 @@
 #include <syslog.h>
 
 #include "event.h"
+#define L2CAP_SOCKET_CHECKED
 #include "btpand.h"
 
 #define		__event_link(ev) \

Modified: head/usr.sbin/bluetooth/btpand/packet.c
==============================================================================
--- head/usr.sbin/bluetooth/btpand/packet.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/btpand/packet.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -30,6 +30,7 @@
 #include <sys/cdefs.h>
 __RCSID("$NetBSD: packet.c,v 1.1 2008/08/17 13:20:57 plunky Exp $");
 
+#define L2CAP_SOCKET_CHECKED
 #include "btpand.h"
 
 packet_t *

Modified: head/usr.sbin/bluetooth/btpand/sdp.c
==============================================================================
--- head/usr.sbin/bluetooth/btpand/sdp.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/btpand/sdp.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -32,6 +32,7 @@ __RCSID("$NetBSD: sdp.c,v 1.2 2008/12/06
 
 #include <string.h>
 
+#define L2CAP_SOCKET_CHECKED
 #include "sdp.h"
 
 /*

Modified: head/usr.sbin/bluetooth/btpand/server.c
==============================================================================
--- head/usr.sbin/bluetooth/btpand/server.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/btpand/server.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -32,6 +32,7 @@ __RCSID("$NetBSD: server.c,v 1.2 2009/01
 
 #include <sys/ioctl.h>
 
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <inttypes.h>
 #include <errno.h>
@@ -103,6 +104,9 @@ server_open(void)
 	sa.l2cap_family = AF_BLUETOOTH;
 	sa.l2cap_len = sizeof(sa);
 	sa.l2cap_psm = htole16(l2cap_psm);
+	sa.l2cap_bdaddr_type = BDADDR_BREDR;
+	sa.l2cap_cid = 0;
+	
 	bdaddr_copy(&sa.l2cap_bdaddr, &local_bdaddr);
 	if (bind(server_fd, (struct sockaddr *)&sa, sizeof(sa)) == -1) {
 		log_err("Could not bind server socket: %m");

Modified: head/usr.sbin/bluetooth/btpand/tap.c
==============================================================================
--- head/usr.sbin/bluetooth/btpand/tap.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/btpand/tap.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -43,6 +43,7 @@ __RCSID("$NetBSD: tap.c,v 1.1 2008/08/17
 #include <stdio.h>
 #include <unistd.h>
 
+#define L2CAP_SOCKET_CHECKED
 #include "btpand.h"
 
 static bool tap_send(channel_t *, packet_t *);

Modified: head/usr.sbin/bluetooth/hccontrol/hccontrol.c
==============================================================================
--- head/usr.sbin/bluetooth/hccontrol/hccontrol.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/hccontrol/hccontrol.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -29,6 +29,7 @@
  * $FreeBSD$
  */
 
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <sys/ioctl.h>
 #include <sys/sysctl.h>

Modified: head/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c
==============================================================================
--- head/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -29,6 +29,7 @@
  * $FreeBSD$
  */
 
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <errno.h>
 #include <stdio.h>

Modified: head/usr.sbin/bluetooth/hccontrol/info.c
==============================================================================
--- head/usr.sbin/bluetooth/hccontrol/info.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/hccontrol/info.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -29,6 +29,7 @@
  * $FreeBSD$
  */
 
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <errno.h>
 #include <stdio.h>

Modified: head/usr.sbin/bluetooth/hccontrol/link_control.c
==============================================================================
--- head/usr.sbin/bluetooth/hccontrol/link_control.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/hccontrol/link_control.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -29,6 +29,7 @@
  * $FreeBSD$
  */
 
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <errno.h>
 #include <stdio.h>

Modified: head/usr.sbin/bluetooth/hccontrol/link_policy.c
==============================================================================
--- head/usr.sbin/bluetooth/hccontrol/link_policy.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/hccontrol/link_policy.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -29,6 +29,7 @@
  * $FreeBSD$
  */
 
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <errno.h>
 #include <stdio.h>

Modified: head/usr.sbin/bluetooth/hccontrol/node.c
==============================================================================
--- head/usr.sbin/bluetooth/hccontrol/node.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/hccontrol/node.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -30,6 +30,7 @@
  */
 
 #include <sys/ioctl.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <errno.h>
 #include <netgraph/ng_message.h>

Modified: head/usr.sbin/bluetooth/hccontrol/util.c
==============================================================================
--- head/usr.sbin/bluetooth/hccontrol/util.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/hccontrol/util.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -30,6 +30,7 @@
  */
  
 #include <sys/param.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <stdio.h>
 #include <string.h>

Modified: head/usr.sbin/bluetooth/hcsecd/hcsecd.c
==============================================================================
--- head/usr.sbin/bluetooth/hcsecd/hcsecd.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/hcsecd/hcsecd.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -30,6 +30,7 @@
  */
 
 #include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <err.h>
 #include <errno.h>

Modified: head/usr.sbin/bluetooth/hcsecd/parser.y
==============================================================================
--- head/usr.sbin/bluetooth/hcsecd/parser.y	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/hcsecd/parser.y	Tue Apr  7 16:48:23 2015	(r281210)
@@ -32,6 +32,7 @@
 
 #include <sys/fcntl.h>
 #include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <errno.h>
 #include <limits.h>

Modified: head/usr.sbin/bluetooth/l2control/l2cap.c
==============================================================================
--- head/usr.sbin/bluetooth/l2control/l2cap.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/l2control/l2cap.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -30,6 +30,7 @@
  */
 
 #include <sys/ioctl.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <errno.h>
 #include <stdio.h>

Modified: head/usr.sbin/bluetooth/l2control/l2control.c
==============================================================================
--- head/usr.sbin/bluetooth/l2control/l2control.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/l2control/l2control.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -30,6 +30,7 @@
  */
 
 #include <assert.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <err.h>
 #include <errno.h>

Modified: head/usr.sbin/bluetooth/l2ping/l2ping.c
==============================================================================
--- head/usr.sbin/bluetooth/l2ping/l2ping.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/l2ping/l2ping.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -34,6 +34,7 @@
 #include <arpa/inet.h>
 #include <netinet/in.h>
 #include <assert.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <err.h>
 #include <errno.h>

Modified: head/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.c
==============================================================================
--- head/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -30,7 +30,7 @@
  * $Id: rfcomm_pppd.c,v 1.5 2003/09/07 18:32:11 max Exp $
  * $FreeBSD$
  */
-
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <ctype.h>
 #include <err.h>

Modified: head/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.c
==============================================================================
--- head/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -30,6 +30,7 @@
  */
 
 #include <assert.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <err.h>
 #include <errno.h>

Modified: head/usr.sbin/bluetooth/sdpcontrol/search.c
==============================================================================
--- head/usr.sbin/bluetooth/sdpcontrol/search.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/sdpcontrol/search.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -30,6 +30,7 @@
  */
 
 #include <netinet/in.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <ctype.h>
 #include <sdp.h>

Modified: head/usr.sbin/bluetooth/sdpd/bgd.c
==============================================================================
--- head/usr.sbin/bluetooth/sdpd/bgd.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/sdpd/bgd.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -28,7 +28,7 @@
  * $Id: bgd.c,v 1.4 2004/01/13 01:54:39 max Exp $
  * $FreeBSD$
  */
-
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <sdp.h>
 #include <string.h>

Modified: head/usr.sbin/bluetooth/sdpd/dun.c
==============================================================================
--- head/usr.sbin/bluetooth/sdpd/dun.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/sdpd/dun.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -30,6 +30,7 @@
  */
 
 #include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <sdp.h>
 #include <string.h>

Modified: head/usr.sbin/bluetooth/sdpd/ftrn.c
==============================================================================
--- head/usr.sbin/bluetooth/sdpd/ftrn.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/sdpd/ftrn.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -30,6 +30,7 @@
  */
 
 #include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <sdp.h>
 #include <string.h>

Modified: head/usr.sbin/bluetooth/sdpd/gn.c
==============================================================================
--- head/usr.sbin/bluetooth/sdpd/gn.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/sdpd/gn.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -32,6 +32,7 @@
  */
 
 #include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <sdp.h>
 #include <string.h>

Modified: head/usr.sbin/bluetooth/sdpd/irmc.c
==============================================================================
--- head/usr.sbin/bluetooth/sdpd/irmc.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/sdpd/irmc.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -30,6 +30,7 @@
  */
 
 #include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <sdp.h>
 #include <string.h>

Modified: head/usr.sbin/bluetooth/sdpd/irmc_command.c
==============================================================================
--- head/usr.sbin/bluetooth/sdpd/irmc_command.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/sdpd/irmc_command.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -30,6 +30,7 @@
  */
 
 #include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <sdp.h>
 #include <string.h>

Modified: head/usr.sbin/bluetooth/sdpd/lan.c
==============================================================================
--- head/usr.sbin/bluetooth/sdpd/lan.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/sdpd/lan.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -31,6 +31,7 @@
 
 #include <arpa/inet.h>
 #include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <sdp.h>
 #include <stdio.h>

Modified: head/usr.sbin/bluetooth/sdpd/main.c
==============================================================================
--- head/usr.sbin/bluetooth/sdpd/main.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/sdpd/main.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -30,6 +30,7 @@
  */
 
 #include <sys/select.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <errno.h>
 #include <grp.h>

Modified: head/usr.sbin/bluetooth/sdpd/nap.c
==============================================================================
--- head/usr.sbin/bluetooth/sdpd/nap.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/sdpd/nap.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -32,6 +32,7 @@
  */
 
 #include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <sdp.h>
 #include <string.h>

Modified: head/usr.sbin/bluetooth/sdpd/opush.c
==============================================================================
--- head/usr.sbin/bluetooth/sdpd/opush.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/sdpd/opush.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -30,6 +30,7 @@
  */
 
 #include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <sdp.h>
 #include <string.h>

Modified: head/usr.sbin/bluetooth/sdpd/panu.c
==============================================================================
--- head/usr.sbin/bluetooth/sdpd/panu.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/sdpd/panu.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -32,6 +32,7 @@
  */
 
 #include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <sdp.h>
 #include <string.h>

Modified: head/usr.sbin/bluetooth/sdpd/profile.c
==============================================================================
--- head/usr.sbin/bluetooth/sdpd/profile.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/sdpd/profile.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -32,6 +32,7 @@
  */
 
 #include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <sdp.h>
 #include <string.h>

Modified: head/usr.sbin/bluetooth/sdpd/provider.c
==============================================================================
--- head/usr.sbin/bluetooth/sdpd/provider.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/sdpd/provider.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -30,6 +30,7 @@
  */
 
 #include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <string.h>
 #include <stdlib.h>

Modified: head/usr.sbin/bluetooth/sdpd/sar.c
==============================================================================
--- head/usr.sbin/bluetooth/sdpd/sar.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/sdpd/sar.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -34,6 +34,7 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <assert.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <errno.h>
 #include <sdp.h>

Modified: head/usr.sbin/bluetooth/sdpd/scr.c
==============================================================================
--- head/usr.sbin/bluetooth/sdpd/scr.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/sdpd/scr.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -30,6 +30,7 @@
  */
 
 #include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <errno.h>
 #include <sdp.h>

Modified: head/usr.sbin/bluetooth/sdpd/sd.c
==============================================================================
--- head/usr.sbin/bluetooth/sdpd/sd.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/sdpd/sd.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -30,6 +30,7 @@
  */
 
 #include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <sdp.h>
 #include <string.h>

Modified: head/usr.sbin/bluetooth/sdpd/server.c
==============================================================================
--- head/usr.sbin/bluetooth/sdpd/server.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/sdpd/server.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -38,6 +38,7 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <assert.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <errno.h>
 #include <pwd.h>

Modified: head/usr.sbin/bluetooth/sdpd/sp.c
==============================================================================
--- head/usr.sbin/bluetooth/sdpd/sp.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/sdpd/sp.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -30,6 +30,7 @@
  */
 
 #include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <sdp.h>
 #include <string.h>

Modified: head/usr.sbin/bluetooth/sdpd/srr.c
==============================================================================
--- head/usr.sbin/bluetooth/sdpd/srr.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/sdpd/srr.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -34,6 +34,7 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <assert.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <errno.h>
 #include <sdp.h>

Modified: head/usr.sbin/bluetooth/sdpd/ssar.c
==============================================================================
--- head/usr.sbin/bluetooth/sdpd/ssar.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/sdpd/ssar.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -30,6 +30,7 @@
  */
 
 #include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <sdp.h>
 #include <string.h>

Modified: head/usr.sbin/bluetooth/sdpd/ssr.c
==============================================================================
--- head/usr.sbin/bluetooth/sdpd/ssr.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/sdpd/ssr.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -34,6 +34,7 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <assert.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <errno.h>
 #include <sdp.h>

Modified: head/usr.sbin/bluetooth/sdpd/sur.c
==============================================================================
--- head/usr.sbin/bluetooth/sdpd/sur.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/sdpd/sur.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -30,6 +30,7 @@
  */
 
 #include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <errno.h>
 #include <sdp.h>

Modified: head/usr.sbin/bluetooth/sdpd/uuid.c
==============================================================================
--- head/usr.sbin/bluetooth/sdpd/uuid.c	Tue Apr  7 15:56:08 2015	(r281209)
+++ head/usr.sbin/bluetooth/sdpd/uuid.c	Tue Apr  7 16:48:23 2015	(r281210)
@@ -28,7 +28,7 @@
  * $Id: uuid.c,v 1.1 2004/12/09 18:20:26 max Exp $
  * $FreeBSD$
  */
-
+#define L2CAP_SOCKET_CHECKED
 #include <bluetooth.h>
 #include <sdp.h>
 #include <uuid.h>


More information about the svn-src-head mailing list