diff options
Diffstat (limited to 'sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c')
-rw-r--r-- | sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c b/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c index e0b57e1..bb66510 100644 --- a/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c +++ b/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c @@ -667,7 +667,8 @@ ng_btsocket_l2cap_raw_bind(struct socket *so, struct sockaddr *nam, return (EINVAL); if (sa->l2cap_family != AF_BLUETOOTH) return (EAFNOSUPPORT); - if (sa->l2cap_len != sizeof(*sa)) + if((sa->l2cap_len != sizeof(*sa))&& + (sa->l2cap_len != sizeof(struct sockaddr_l2cap_compat))) return (EINVAL); if (bcmp(&sa->l2cap_bdaddr, NG_HCI_BDADDR_ANY, @@ -720,8 +721,10 @@ ng_btsocket_l2cap_raw_connect(struct socket *so, struct sockaddr *nam, return (EINVAL); if (sa->l2cap_family != AF_BLUETOOTH) return (EAFNOSUPPORT); - if (sa->l2cap_len != sizeof(*sa)) + if((sa->l2cap_len != sizeof(*sa))&& + (sa->l2cap_len != sizeof(struct sockaddr_l2cap_compat))) return (EINVAL); + if (bcmp(&sa->l2cap_bdaddr, NG_HCI_BDADDR_ANY, sizeof(bdaddr_t)) == 0) return (EINVAL); @@ -1179,6 +1182,8 @@ ng_btsocket_l2cap_raw_peeraddr(struct socket *so, struct sockaddr **nam) sa.l2cap_psm = 0; sa.l2cap_len = sizeof(sa); sa.l2cap_family = AF_BLUETOOTH; + sa.l2cap_cid = 0; + sa.l2cap_bdaddr_type = BDADDR_BREDR; *nam = sodupsockaddr((struct sockaddr *) &sa, M_NOWAIT); @@ -1221,7 +1226,8 @@ ng_btsocket_l2cap_raw_sockaddr(struct socket *so, struct sockaddr **nam) sa.l2cap_psm = 0; sa.l2cap_len = sizeof(sa); sa.l2cap_family = AF_BLUETOOTH; - + sa.l2cap_cid = 0; + sa.l2cap_bdaddr_type = BDADDR_BREDR; *nam = sodupsockaddr((struct sockaddr *) &sa, M_NOWAIT); return ((*nam == NULL)? ENOMEM : 0); |