summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakanori Watanabe <takawata@FreeBSD.org>2015-04-07 16:48:23 +0000
committerTakanori Watanabe <takawata@FreeBSD.org>2015-04-07 16:48:23 +0000
commit8d6f425ddd8021ae2257ba9682f8844254ecdde1 (patch)
tree3407105e73d99b25919959b8ea59bc192c2c9f36
parent212236608c8e01c8e4c65053539714d897e1482b (diff)
Notes
-rw-r--r--lib/libbluetooth/bluetooth.c2
-rw-r--r--lib/libbluetooth/dev.c1
-rw-r--r--lib/libbluetooth/hci.c1
-rw-r--r--lib/libsdp/search.c1
-rw-r--r--lib/libsdp/service.c1
-rw-r--r--lib/libsdp/session.c5
-rw-r--r--lib/libsdp/util.c1
-rw-r--r--usr.bin/bluetooth/bthost/bthost.c1
-rw-r--r--usr.bin/bluetooth/btsockstat/btsockstat.c1
-rw-r--r--usr.bin/bluetooth/rfcomm_sppd/rfcomm_sdp.c2
-rw-r--r--usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c1
-rw-r--r--usr.sbin/bluetooth/bthidcontrol/bthidcontrol.c1
-rw-r--r--usr.sbin/bluetooth/bthidcontrol/hid.c1
-rw-r--r--usr.sbin/bluetooth/bthidcontrol/sdp.c1
-rw-r--r--usr.sbin/bluetooth/bthidd/bthidd.c1
-rw-r--r--usr.sbin/bluetooth/bthidd/client.c5
-rw-r--r--usr.sbin/bluetooth/bthidd/hid.c1
-rw-r--r--usr.sbin/bluetooth/bthidd/kbd.c1
-rw-r--r--usr.sbin/bluetooth/bthidd/lexer.l2
-rw-r--r--usr.sbin/bluetooth/bthidd/parser.y1
-rw-r--r--usr.sbin/bluetooth/bthidd/server.c5
-rw-r--r--usr.sbin/bluetooth/bthidd/session.c1
-rw-r--r--usr.sbin/bluetooth/btpand/bnep.c1
-rw-r--r--usr.sbin/bluetooth/btpand/btpand.c1
-rw-r--r--usr.sbin/bluetooth/btpand/channel.c2
-rw-r--r--usr.sbin/bluetooth/btpand/client.c4
-rw-r--r--usr.sbin/bluetooth/btpand/event.c1
-rw-r--r--usr.sbin/bluetooth/btpand/packet.c1
-rw-r--r--usr.sbin/bluetooth/btpand/sdp.c1
-rw-r--r--usr.sbin/bluetooth/btpand/server.c4
-rw-r--r--usr.sbin/bluetooth/btpand/tap.c1
-rw-r--r--usr.sbin/bluetooth/hccontrol/hccontrol.c1
-rw-r--r--usr.sbin/bluetooth/hccontrol/host_controller_baseband.c1
-rw-r--r--usr.sbin/bluetooth/hccontrol/info.c1
-rw-r--r--usr.sbin/bluetooth/hccontrol/link_control.c1
-rw-r--r--usr.sbin/bluetooth/hccontrol/link_policy.c1
-rw-r--r--usr.sbin/bluetooth/hccontrol/node.c1
-rw-r--r--usr.sbin/bluetooth/hccontrol/util.c1
-rw-r--r--usr.sbin/bluetooth/hcsecd/hcsecd.c1
-rw-r--r--usr.sbin/bluetooth/hcsecd/parser.y1
-rw-r--r--usr.sbin/bluetooth/l2control/l2cap.c1
-rw-r--r--usr.sbin/bluetooth/l2control/l2control.c1
-rw-r--r--usr.sbin/bluetooth/l2ping/l2ping.c1
-rw-r--r--usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.c2
-rw-r--r--usr.sbin/bluetooth/sdpcontrol/sdpcontrol.c1
-rw-r--r--usr.sbin/bluetooth/sdpcontrol/search.c1
-rw-r--r--usr.sbin/bluetooth/sdpd/bgd.c2
-rw-r--r--usr.sbin/bluetooth/sdpd/dun.c1
-rw-r--r--usr.sbin/bluetooth/sdpd/ftrn.c1
-rw-r--r--usr.sbin/bluetooth/sdpd/gn.c1
-rw-r--r--usr.sbin/bluetooth/sdpd/irmc.c1
-rw-r--r--usr.sbin/bluetooth/sdpd/irmc_command.c1
-rw-r--r--usr.sbin/bluetooth/sdpd/lan.c1
-rw-r--r--usr.sbin/bluetooth/sdpd/main.c1
-rw-r--r--usr.sbin/bluetooth/sdpd/nap.c1
-rw-r--r--usr.sbin/bluetooth/sdpd/opush.c1
-rw-r--r--usr.sbin/bluetooth/sdpd/panu.c1
-rw-r--r--usr.sbin/bluetooth/sdpd/profile.c1
-rw-r--r--usr.sbin/bluetooth/sdpd/provider.c1
-rw-r--r--usr.sbin/bluetooth/sdpd/sar.c1
-rw-r--r--usr.sbin/bluetooth/sdpd/scr.c1
-rw-r--r--usr.sbin/bluetooth/sdpd/sd.c1
-rw-r--r--usr.sbin/bluetooth/sdpd/server.c1
-rw-r--r--usr.sbin/bluetooth/sdpd/sp.c1
-rw-r--r--usr.sbin/bluetooth/sdpd/srr.c1
-rw-r--r--usr.sbin/bluetooth/sdpd/ssar.c1
-rw-r--r--usr.sbin/bluetooth/sdpd/ssr.c1
-rw-r--r--usr.sbin/bluetooth/sdpd/sur.c1
-rw-r--r--usr.sbin/bluetooth/sdpd/uuid.c2
69 files changed, 84 insertions, 10 deletions
diff --git a/lib/libbluetooth/bluetooth.c b/lib/libbluetooth/bluetooth.c
index 23b7df0da9701..bbcf0071cfe04 100644
--- a/lib/libbluetooth/bluetooth.c
+++ b/lib/libbluetooth/bluetooth.c
@@ -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>
diff --git a/lib/libbluetooth/dev.c b/lib/libbluetooth/dev.c
index 1f9e745dd46a0..a6295dd2b1f08 100644
--- a/lib/libbluetooth/dev.c
+++ b/lib/libbluetooth/dev.c
@@ -30,6 +30,7 @@
* $FreeBSD$
*/
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <stdio.h>
#include <string.h>
diff --git a/lib/libbluetooth/hci.c b/lib/libbluetooth/hci.c
index 1ae6ff963d7b2..651c0dda1fe7e 100644
--- a/lib/libbluetooth/hci.c
+++ b/lib/libbluetooth/hci.c
@@ -31,6 +31,7 @@
*/
#include <assert.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <inttypes.h>
#include <stdio.h>
diff --git a/lib/libsdp/search.c b/lib/libsdp/search.c
index 868fbe562ffeb..fa2a92d05a612 100644
--- a/lib/libsdp/search.c
+++ b/lib/libsdp/search.c
@@ -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>
diff --git a/lib/libsdp/service.c b/lib/libsdp/service.c
index 2667966c78228..53c8909bb2f33 100644
--- a/lib/libsdp/service.c
+++ b/lib/libsdp/service.c
@@ -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>
diff --git a/lib/libsdp/session.c b/lib/libsdp/session.c
index a31f3278dc0fa..a74ce5fea359f 100644
--- a/lib/libsdp/session.c
+++ b/lib/libsdp/session.c
@@ -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 const *r)
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;
diff --git a/lib/libsdp/util.c b/lib/libsdp/util.c
index b996bd22160dc..5ef4a1dfd3769 100644
--- a/lib/libsdp/util.c
+++ b/lib/libsdp/util.c
@@ -30,6 +30,7 @@
*/
#include <netinet/in.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <stdio.h>
#include <sdp.h>
diff --git a/usr.bin/bluetooth/bthost/bthost.c b/usr.bin/bluetooth/bthost/bthost.c
index 2dd56359fbaf7..69ce3f57f0186 100644
--- a/usr.bin/bluetooth/bthost/bthost.c
+++ b/usr.bin/bluetooth/bthost/bthost.c
@@ -29,6 +29,7 @@
* $FreeBSD$
*/
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.bin/bluetooth/btsockstat/btsockstat.c b/usr.bin/bluetooth/btsockstat/btsockstat.c
index a9c93542cfb8d..aa85286ee9d10 100644
--- a/usr.bin/bluetooth/btsockstat/btsockstat.c
+++ b/usr.bin/bluetooth/btsockstat/btsockstat.c
@@ -39,6 +39,7 @@
#include <net/if.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <err.h>
#include <fcntl.h>
diff --git a/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sdp.c b/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sdp.c
index 5873071533338..239597dc755d9 100644
--- a/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sdp.c
+++ b/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sdp.c
@@ -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>
diff --git a/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c b/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c
index ab6e1a77e8c71..309bab93ac21b 100644
--- a/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c
+++ b/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c
@@ -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>
diff --git a/usr.sbin/bluetooth/bthidcontrol/bthidcontrol.c b/usr.sbin/bluetooth/bthidcontrol/bthidcontrol.c
index 900bda5d559b2..0f795dd5b1597 100644
--- a/usr.sbin/bluetooth/bthidcontrol/bthidcontrol.c
+++ b/usr.sbin/bluetooth/bthidcontrol/bthidcontrol.c
@@ -31,6 +31,7 @@
#include <sys/queue.h>
#include <assert.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <err.h>
#include <errno.h>
diff --git a/usr.sbin/bluetooth/bthidcontrol/hid.c b/usr.sbin/bluetooth/bthidcontrol/hid.c
index 9fb6220da5a82..e43ef6a1101ea 100644
--- a/usr.sbin/bluetooth/bthidcontrol/hid.c
+++ b/usr.sbin/bluetooth/bthidcontrol/hid.c
@@ -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>
diff --git a/usr.sbin/bluetooth/bthidcontrol/sdp.c b/usr.sbin/bluetooth/bthidcontrol/sdp.c
index a0b4534e4cad5..3beabc14be775 100644
--- a/usr.sbin/bluetooth/bthidcontrol/sdp.c
+++ b/usr.sbin/bluetooth/bthidcontrol/sdp.c
@@ -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>
diff --git a/usr.sbin/bluetooth/bthidd/bthidd.c b/usr.sbin/bluetooth/bthidd/bthidd.c
index b93fd3dd6df41..7e988fced0ba6 100644
--- a/usr.sbin/bluetooth/bthidd/bthidd.c
+++ b/usr.sbin/bluetooth/bthidd/bthidd.c
@@ -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>
diff --git a/usr.sbin/bluetooth/bthidd/client.c b/usr.sbin/bluetooth/bthidd/client.c
index 59f0d19a1ce8d..5f01133d20c29 100644
--- a/usr.sbin/bluetooth/bthidd/client.c
+++ b/usr.sbin/bluetooth/bthidd/client.c
@@ -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 psm)
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);
diff --git a/usr.sbin/bluetooth/bthidd/hid.c b/usr.sbin/bluetooth/bthidd/hid.c
index 0a5ebffe4109e..69a6fdcc4d28d 100644
--- a/usr.sbin/bluetooth/bthidd/hid.c
+++ b/usr.sbin/bluetooth/bthidd/hid.c
@@ -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>
diff --git a/usr.sbin/bluetooth/bthidd/kbd.c b/usr.sbin/bluetooth/bthidd/kbd.c
index 20b627847a027..e570b80863f76 100644
--- a/usr.sbin/bluetooth/bthidd/kbd.c
+++ b/usr.sbin/bluetooth/bthidd/kbd.c
@@ -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>
diff --git a/usr.sbin/bluetooth/bthidd/lexer.l b/usr.sbin/bluetooth/bthidd/lexer.l
index b9f62a1e7ca27..6d913eede7789 100644
--- a/usr.sbin/bluetooth/bthidd/lexer.l
+++ b/usr.sbin/bluetooth/bthidd/lexer.l
@@ -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"
diff --git a/usr.sbin/bluetooth/bthidd/parser.y b/usr.sbin/bluetooth/bthidd/parser.y
index 50468f4e03a85..dbb27632680cd 100644
--- a/usr.sbin/bluetooth/bthidd/parser.y
+++ b/usr.sbin/bluetooth/bthidd/parser.y
@@ -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>
diff --git a/usr.sbin/bluetooth/bthidd/server.c b/usr.sbin/bluetooth/bthidd/server.c
index d76bd62664eb3..26aeb4a961a18 100644
--- a/usr.sbin/bluetooth/bthidd/server.c
+++ b/usr.sbin/bluetooth/bthidd/server.c
@@ -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);
diff --git a/usr.sbin/bluetooth/bthidd/session.c b/usr.sbin/bluetooth/bthidd/session.c
index b9f331bf7e7f1..260cb8654d720 100644
--- a/usr.sbin/bluetooth/bthidd/session.c
+++ b/usr.sbin/bluetooth/bthidd/session.c
@@ -33,6 +33,7 @@
#include <sys/queue.h>
#include <assert.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <fcntl.h>
diff --git a/usr.sbin/bluetooth/btpand/bnep.c b/usr.sbin/bluetooth/btpand/bnep.c
index 200a723011835..4065b1ba8e0c3 100644
--- a/usr.sbin/bluetooth/btpand/bnep.c
+++ b/usr.sbin/bluetooth/btpand/bnep.c
@@ -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>
diff --git a/usr.sbin/bluetooth/btpand/btpand.c b/usr.sbin/bluetooth/btpand/btpand.c
index 938744448bea2..243fcf5292b91 100644
--- a/usr.sbin/bluetooth/btpand/btpand.c
+++ b/usr.sbin/bluetooth/btpand/btpand.c
@@ -33,6 +33,7 @@ __RCSID("$NetBSD: btpand.c,v 1.1 2008/08/17 13:20:57 plunky Exp $");
#include <sys/wait.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <err.h>
#include <fcntl.h>
diff --git a/usr.sbin/bluetooth/btpand/channel.c b/usr.sbin/bluetooth/btpand/channel.c
index b4eb4ab49c8f4..32f248718e3ae 100644
--- a/usr.sbin/bluetooth/btpand/channel.c
+++ b/usr.sbin/bluetooth/btpand/channel.c
@@ -35,7 +35,7 @@ __RCSID("$NetBSD: channel.c,v 1.1 2008/08/17 13:20:57 plunky Exp $");
#include <libutil.h>
#include <unistd.h>
-
+#define L2CAP_SOCKET_CHECKED
#include "btpand.h"
static struct chlist channel_list;
diff --git a/usr.sbin/bluetooth/btpand/client.c b/usr.sbin/bluetooth/btpand/client.c
index 2cc908996584e..f88dc6ee50984 100644
--- a/usr.sbin/bluetooth/btpand/client.c
+++ b/usr.sbin/bluetooth/btpand/client.c
@@ -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");
diff --git a/usr.sbin/bluetooth/btpand/event.c b/usr.sbin/bluetooth/btpand/event.c
index 159f90c862d4c..ac51f57d14807 100644
--- a/usr.sbin/bluetooth/btpand/event.c
+++ b/usr.sbin/bluetooth/btpand/event.c
@@ -45,6 +45,7 @@
#include <syslog.h>
#include "event.h"
+#define L2CAP_SOCKET_CHECKED
#include "btpand.h"
#define __event_link(ev) \
diff --git a/usr.sbin/bluetooth/btpand/packet.c b/usr.sbin/bluetooth/btpand/packet.c
index e42e5c5b30459..21a563c754e3f 100644
--- a/usr.sbin/bluetooth/btpand/packet.c
+++ b/usr.sbin/bluetooth/btpand/packet.c
@@ -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 *
diff --git a/usr.sbin/bluetooth/btpand/sdp.c b/usr.sbin/bluetooth/btpand/sdp.c
index e5aec1c6bbba7..3cad3f8fbefa0 100644
--- a/usr.sbin/bluetooth/btpand/sdp.c
+++ b/usr.sbin/bluetooth/btpand/sdp.c
@@ -32,6 +32,7 @@ __RCSID("$NetBSD: sdp.c,v 1.2 2008/12/06 20:01:14 plunky Exp $");
#include <string.h>
+#define L2CAP_SOCKET_CHECKED
#include "sdp.h"
/*
diff --git a/usr.sbin/bluetooth/btpand/server.c b/usr.sbin/bluetooth/btpand/server.c
index b24d416ff1969..b72b0322b0f36 100644
--- a/usr.sbin/bluetooth/btpand/server.c
+++ b/usr.sbin/bluetooth/btpand/server.c
@@ -32,6 +32,7 @@ __RCSID("$NetBSD: server.c,v 1.2 2009/01/24 17:29:28 plunky Exp $");
#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");
diff --git a/usr.sbin/bluetooth/btpand/tap.c b/usr.sbin/bluetooth/btpand/tap.c
index c96563338ea20..644bf02366fae 100644
--- a/usr.sbin/bluetooth/btpand/tap.c
+++ b/usr.sbin/bluetooth/btpand/tap.c
@@ -43,6 +43,7 @@ __RCSID("$NetBSD: tap.c,v 1.1 2008/08/17 13:20:57 plunky Exp $");
#include <stdio.h>
#include <unistd.h>
+#define L2CAP_SOCKET_CHECKED
#include "btpand.h"
static bool tap_send(channel_t *, packet_t *);
diff --git a/usr.sbin/bluetooth/hccontrol/hccontrol.c b/usr.sbin/bluetooth/hccontrol/hccontrol.c
index 089869b3cf03b..9c60ae8b3149f 100644
--- a/usr.sbin/bluetooth/hccontrol/hccontrol.c
+++ b/usr.sbin/bluetooth/hccontrol/hccontrol.c
@@ -29,6 +29,7 @@
* $FreeBSD$
*/
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sys/ioctl.h>
#include <sys/sysctl.h>
diff --git a/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c b/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c
index aae5dd1457eda..213b017c43465 100644
--- a/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c
+++ b/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c
@@ -29,6 +29,7 @@
* $FreeBSD$
*/
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <stdio.h>
diff --git a/usr.sbin/bluetooth/hccontrol/info.c b/usr.sbin/bluetooth/hccontrol/info.c
index d7bad36bb8ded..ee9d1a1643281 100644
--- a/usr.sbin/bluetooth/hccontrol/info.c
+++ b/usr.sbin/bluetooth/hccontrol/info.c
@@ -29,6 +29,7 @@
* $FreeBSD$
*/
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <stdio.h>
diff --git a/usr.sbin/bluetooth/hccontrol/link_control.c b/usr.sbin/bluetooth/hccontrol/link_control.c
index 536520a712989..a55426c088a8e 100644
--- a/usr.sbin/bluetooth/hccontrol/link_control.c
+++ b/usr.sbin/bluetooth/hccontrol/link_control.c
@@ -29,6 +29,7 @@
* $FreeBSD$
*/
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <stdio.h>
diff --git a/usr.sbin/bluetooth/hccontrol/link_policy.c b/usr.sbin/bluetooth/hccontrol/link_policy.c
index 67b32d5a0d61b..8142b2365f106 100644
--- a/usr.sbin/bluetooth/hccontrol/link_policy.c
+++ b/usr.sbin/bluetooth/hccontrol/link_policy.c
@@ -29,6 +29,7 @@
* $FreeBSD$
*/
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <stdio.h>
diff --git a/usr.sbin/bluetooth/hccontrol/node.c b/usr.sbin/bluetooth/hccontrol/node.c
index ede2153b6cedb..fb6fd199376bc 100644
--- a/usr.sbin/bluetooth/hccontrol/node.c
+++ b/usr.sbin/bluetooth/hccontrol/node.c
@@ -30,6 +30,7 @@
*/
#include <sys/ioctl.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <netgraph/ng_message.h>
diff --git a/usr.sbin/bluetooth/hccontrol/util.c b/usr.sbin/bluetooth/hccontrol/util.c
index 4bb5000c087a8..13e8cb09073cd 100644
--- a/usr.sbin/bluetooth/hccontrol/util.c
+++ b/usr.sbin/bluetooth/hccontrol/util.c
@@ -30,6 +30,7 @@
*/
#include <sys/param.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <stdio.h>
#include <string.h>
diff --git a/usr.sbin/bluetooth/hcsecd/hcsecd.c b/usr.sbin/bluetooth/hcsecd/hcsecd.c
index 72f9c8cb8fdfb..15b5ca45138e1 100644
--- a/usr.sbin/bluetooth/hcsecd/hcsecd.c
+++ b/usr.sbin/bluetooth/hcsecd/hcsecd.c
@@ -30,6 +30,7 @@
*/
#include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <err.h>
#include <errno.h>
diff --git a/usr.sbin/bluetooth/hcsecd/parser.y b/usr.sbin/bluetooth/hcsecd/parser.y
index ec91c484cae2c..cfaeb022b89ee 100644
--- a/usr.sbin/bluetooth/hcsecd/parser.y
+++ b/usr.sbin/bluetooth/hcsecd/parser.y
@@ -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>
diff --git a/usr.sbin/bluetooth/l2control/l2cap.c b/usr.sbin/bluetooth/l2control/l2cap.c
index c23106c3db3fe..44009ef2ef409 100644
--- a/usr.sbin/bluetooth/l2control/l2cap.c
+++ b/usr.sbin/bluetooth/l2control/l2cap.c
@@ -30,6 +30,7 @@
*/
#include <sys/ioctl.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <stdio.h>
diff --git a/usr.sbin/bluetooth/l2control/l2control.c b/usr.sbin/bluetooth/l2control/l2control.c
index fdbf2f5b841d7..87ec2371a3600 100644
--- a/usr.sbin/bluetooth/l2control/l2control.c
+++ b/usr.sbin/bluetooth/l2control/l2control.c
@@ -30,6 +30,7 @@
*/
#include <assert.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <err.h>
#include <errno.h>
diff --git a/usr.sbin/bluetooth/l2ping/l2ping.c b/usr.sbin/bluetooth/l2ping/l2ping.c
index 4baa3540d14b1..92e7a0aa777be 100644
--- a/usr.sbin/bluetooth/l2ping/l2ping.c
+++ b/usr.sbin/bluetooth/l2ping/l2ping.c
@@ -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>
diff --git a/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.c b/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.c
index 956dc4d838397..e970fb030be1b 100644
--- a/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.c
+++ b/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.c
@@ -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>
diff --git a/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.c b/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.c
index fca2015c9c029..65ee3d0f92345 100644
--- a/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.c
+++ b/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.c
@@ -30,6 +30,7 @@
*/
#include <assert.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <err.h>
#include <errno.h>
diff --git a/usr.sbin/bluetooth/sdpcontrol/search.c b/usr.sbin/bluetooth/sdpcontrol/search.c
index e7d824436aa4b..acc8c167ed6e9 100644
--- a/usr.sbin/bluetooth/sdpcontrol/search.c
+++ b/usr.sbin/bluetooth/sdpcontrol/search.c
@@ -30,6 +30,7 @@
*/
#include <netinet/in.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <ctype.h>
#include <sdp.h>
diff --git a/usr.sbin/bluetooth/sdpd/bgd.c b/usr.sbin/bluetooth/sdpd/bgd.c
index 70dda891072f5..2c4e4d9698b58 100644
--- a/usr.sbin/bluetooth/sdpd/bgd.c
+++ b/usr.sbin/bluetooth/sdpd/bgd.c
@@ -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>
diff --git a/usr.sbin/bluetooth/sdpd/dun.c b/usr.sbin/bluetooth/sdpd/dun.c
index e7aeb78d679ea..1496285a68c24 100644
--- a/usr.sbin/bluetooth/sdpd/dun.c
+++ b/usr.sbin/bluetooth/sdpd/dun.c
@@ -30,6 +30,7 @@
*/
#include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sdp.h>
#include <string.h>
diff --git a/usr.sbin/bluetooth/sdpd/ftrn.c b/usr.sbin/bluetooth/sdpd/ftrn.c
index bcebfc79807fa..bc1095eada3d2 100644
--- a/usr.sbin/bluetooth/sdpd/ftrn.c
+++ b/usr.sbin/bluetooth/sdpd/ftrn.c
@@ -30,6 +30,7 @@
*/
#include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sdp.h>
#include <string.h>
diff --git a/usr.sbin/bluetooth/sdpd/gn.c b/usr.sbin/bluetooth/sdpd/gn.c
index d35c0eea5fdab..c2bea48113500 100644
--- a/usr.sbin/bluetooth/sdpd/gn.c
+++ b/usr.sbin/bluetooth/sdpd/gn.c
@@ -32,6 +32,7 @@
*/
#include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sdp.h>
#include <string.h>
diff --git a/usr.sbin/bluetooth/sdpd/irmc.c b/usr.sbin/bluetooth/sdpd/irmc.c
index d28a1205be670..2b8f317469660 100644
--- a/usr.sbin/bluetooth/sdpd/irmc.c
+++ b/usr.sbin/bluetooth/sdpd/irmc.c
@@ -30,6 +30,7 @@
*/
#include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sdp.h>
#include <string.h>
diff --git a/usr.sbin/bluetooth/sdpd/irmc_command.c b/usr.sbin/bluetooth/sdpd/irmc_command.c
index 10dafe0b1ed27..a55e1337985dc 100644
--- a/usr.sbin/bluetooth/sdpd/irmc_command.c
+++ b/usr.sbin/bluetooth/sdpd/irmc_command.c
@@ -30,6 +30,7 @@
*/
#include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sdp.h>
#include <string.h>
diff --git a/usr.sbin/bluetooth/sdpd/lan.c b/usr.sbin/bluetooth/sdpd/lan.c
index 2425a89db5a2f..3ed2b1243c4fa 100644
--- a/usr.sbin/bluetooth/sdpd/lan.c
+++ b/usr.sbin/bluetooth/sdpd/lan.c
@@ -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>
diff --git a/usr.sbin/bluetooth/sdpd/main.c b/usr.sbin/bluetooth/sdpd/main.c
index 1df3bf0d5887b..a287b9b70fd46 100644
--- a/usr.sbin/bluetooth/sdpd/main.c
+++ b/usr.sbin/bluetooth/sdpd/main.c
@@ -30,6 +30,7 @@
*/
#include <sys/select.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <grp.h>
diff --git a/usr.sbin/bluetooth/sdpd/nap.c b/usr.sbin/bluetooth/sdpd/nap.c
index 5a857d8e91adc..c034ee68909bf 100644
--- a/usr.sbin/bluetooth/sdpd/nap.c
+++ b/usr.sbin/bluetooth/sdpd/nap.c
@@ -32,6 +32,7 @@
*/
#include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sdp.h>
#include <string.h>
diff --git a/usr.sbin/bluetooth/sdpd/opush.c b/usr.sbin/bluetooth/sdpd/opush.c
index 36359daa98ef6..bcdfda2733be4 100644
--- a/usr.sbin/bluetooth/sdpd/opush.c
+++ b/usr.sbin/bluetooth/sdpd/opush.c
@@ -30,6 +30,7 @@
*/
#include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sdp.h>
#include <string.h>
diff --git a/usr.sbin/bluetooth/sdpd/panu.c b/usr.sbin/bluetooth/sdpd/panu.c
index e00f6503c9249..5b2773e44e4a0 100644
--- a/usr.sbin/bluetooth/sdpd/panu.c
+++ b/usr.sbin/bluetooth/sdpd/panu.c
@@ -32,6 +32,7 @@
*/
#include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sdp.h>
#include <string.h>
diff --git a/usr.sbin/bluetooth/sdpd/profile.c b/usr.sbin/bluetooth/sdpd/profile.c
index f3dfaa7652a39..5c25d037378e3 100644
--- a/usr.sbin/bluetooth/sdpd/profile.c
+++ b/usr.sbin/bluetooth/sdpd/profile.c
@@ -32,6 +32,7 @@
*/
#include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sdp.h>
#include <string.h>
diff --git a/usr.sbin/bluetooth/sdpd/provider.c b/usr.sbin/bluetooth/sdpd/provider.c
index b0f5347018f86..0243305b0d9f0 100644
--- a/usr.sbin/bluetooth/sdpd/provider.c
+++ b/usr.sbin/bluetooth/sdpd/provider.c
@@ -30,6 +30,7 @@
*/
#include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <string.h>
#include <stdlib.h>
diff --git a/usr.sbin/bluetooth/sdpd/sar.c b/usr.sbin/bluetooth/sdpd/sar.c
index 4fc25d92b1188..705f7161eaadd 100644
--- a/usr.sbin/bluetooth/sdpd/sar.c
+++ b/usr.sbin/bluetooth/sdpd/sar.c
@@ -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>
diff --git a/usr.sbin/bluetooth/sdpd/scr.c b/usr.sbin/bluetooth/sdpd/scr.c
index d0c9ec5f29d6c..1df72d1df5da6 100644
--- a/usr.sbin/bluetooth/sdpd/scr.c
+++ b/usr.sbin/bluetooth/sdpd/scr.c
@@ -30,6 +30,7 @@
*/
#include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <sdp.h>
diff --git a/usr.sbin/bluetooth/sdpd/sd.c b/usr.sbin/bluetooth/sdpd/sd.c
index 1743ea7dc406b..c5397ce084da3 100644
--- a/usr.sbin/bluetooth/sdpd/sd.c
+++ b/usr.sbin/bluetooth/sdpd/sd.c
@@ -30,6 +30,7 @@
*/
#include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sdp.h>
#include <string.h>
diff --git a/usr.sbin/bluetooth/sdpd/server.c b/usr.sbin/bluetooth/sdpd/server.c
index 4ef153b1661fa..abd181574f002 100644
--- a/usr.sbin/bluetooth/sdpd/server.c
+++ b/usr.sbin/bluetooth/sdpd/server.c
@@ -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>
diff --git a/usr.sbin/bluetooth/sdpd/sp.c b/usr.sbin/bluetooth/sdpd/sp.c
index 31a9585a25e1c..48edc77fe7fbc 100644
--- a/usr.sbin/bluetooth/sdpd/sp.c
+++ b/usr.sbin/bluetooth/sdpd/sp.c
@@ -30,6 +30,7 @@
*/
#include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sdp.h>
#include <string.h>
diff --git a/usr.sbin/bluetooth/sdpd/srr.c b/usr.sbin/bluetooth/sdpd/srr.c
index fd636d56d4460..60f48ca439b96 100644
--- a/usr.sbin/bluetooth/sdpd/srr.c
+++ b/usr.sbin/bluetooth/sdpd/srr.c
@@ -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>
diff --git a/usr.sbin/bluetooth/sdpd/ssar.c b/usr.sbin/bluetooth/sdpd/ssar.c
index eac92351c8241..5e52e80e4c7ba 100644
--- a/usr.sbin/bluetooth/sdpd/ssar.c
+++ b/usr.sbin/bluetooth/sdpd/ssar.c
@@ -30,6 +30,7 @@
*/
#include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <sdp.h>
#include <string.h>
diff --git a/usr.sbin/bluetooth/sdpd/ssr.c b/usr.sbin/bluetooth/sdpd/ssr.c
index ac27548575cc3..785c8cac3755c 100644
--- a/usr.sbin/bluetooth/sdpd/ssr.c
+++ b/usr.sbin/bluetooth/sdpd/ssr.c
@@ -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>
diff --git a/usr.sbin/bluetooth/sdpd/sur.c b/usr.sbin/bluetooth/sdpd/sur.c
index 143eaf3dbec98..581b593f30012 100644
--- a/usr.sbin/bluetooth/sdpd/sur.c
+++ b/usr.sbin/bluetooth/sdpd/sur.c
@@ -30,6 +30,7 @@
*/
#include <sys/queue.h>
+#define L2CAP_SOCKET_CHECKED
#include <bluetooth.h>
#include <errno.h>
#include <sdp.h>
diff --git a/usr.sbin/bluetooth/sdpd/uuid.c b/usr.sbin/bluetooth/sdpd/uuid.c
index 1989bc5e797d1..dff8d2c66b936 100644
--- a/usr.sbin/bluetooth/sdpd/uuid.c
+++ b/usr.sbin/bluetooth/sdpd/uuid.c
@@ -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>