Fix rfcomm_sppd regression I could reproduced.

To reproduce it, Two machine running FreeBSD and
run
rfcomm_sppd -c 3 -S
rfcomm_sppd -a ${PEER} -c 3
on each side.
This commit is contained in:
Takanori Watanabe 2015-07-07 15:56:51 +00:00
parent 9129dd59be
commit 99043514c6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=285244
2 changed files with 5 additions and 1 deletions

View file

@ -398,7 +398,7 @@ ng_l2cap_l2ca_con_ind(ng_l2cap_chan_p ch)
ip->lcid = ch->scid;
ip->psm = ch->psm;
ip->ident = ch->ident;
ip->linktype = ch->con->linktype;
NG_SEND_MSG_HOOK(error, l2cap->node, msg, l2cap->l2c, 0);
}

View file

@ -1339,6 +1339,8 @@ ng_btsocket_rfcomm_session_create(ng_btsocket_rfcomm_session_p *sp,
l2sa.l2cap_family = AF_BLUETOOTH;
l2sa.l2cap_psm = (dst == NULL)? htole16(NG_L2CAP_PSM_RFCOMM) : 0;
bcopy(src, &l2sa.l2cap_bdaddr, sizeof(l2sa.l2cap_bdaddr));
l2sa.l2cap_cid = 0;
l2sa.l2cap_bdaddr_type = BDADDR_BREDR;
error = sobind(s->l2so, (struct sockaddr *) &l2sa, td);
if (error != 0)
@ -1360,6 +1362,8 @@ ng_btsocket_rfcomm_session_create(ng_btsocket_rfcomm_session_p *sp,
l2sa.l2cap_family = AF_BLUETOOTH;
l2sa.l2cap_psm = htole16(NG_L2CAP_PSM_RFCOMM);
bcopy(dst, &l2sa.l2cap_bdaddr, sizeof(l2sa.l2cap_bdaddr));
l2sa.l2cap_cid = 0;
l2sa.l2cap_bdaddr_type = BDADDR_BREDR;
error = soconnect(s->l2so, (struct sockaddr *) &l2sa, td);
if (error != 0)