Module Name: src Committed By: martin Date: Thu Aug 31 11:21:43 UTC 2017
Modified Files: src/usr.sbin/bta2dpd/bta2dpd [netbsd-8]: bta2dpd.c Log Message: Pull up following revision(s) (requested by nat in ticket #242): usr.sbin/bta2dpd/bta2dpd/bta2dpd.c: revision 1.4 Connection state machine improvement upon transition from AVDTP_OPEN to AVDTP_START/SUSPEND. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.3.2.1 src/usr.sbin/bta2dpd/bta2dpd/bta2dpd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.sbin/bta2dpd/bta2dpd/bta2dpd.c diff -u src/usr.sbin/bta2dpd/bta2dpd/bta2dpd.c:1.3 src/usr.sbin/bta2dpd/bta2dpd/bta2dpd.c:1.3.2.1 --- src/usr.sbin/bta2dpd/bta2dpd/bta2dpd.c:1.3 Sat May 27 10:04:57 2017 +++ src/usr.sbin/bta2dpd/bta2dpd/bta2dpd.c Thu Aug 31 11:21:43 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: bta2dpd.c,v 1.3 2017/05/27 10:04:57 nat Exp $ */ +/* $NetBSD: bta2dpd.c,v 1.3.2.1 2017/08/31 11:21:43 martin Exp $ */ /*- * Copyright (c) 2015 - 2016 Nathanial Sloss <nathanialsl...@yahoo.com.au> @@ -674,7 +674,8 @@ do_ctlreq(int fd, short ev, void *arg) case AVDTP_SUSPEND: case AVDTP_START: avdtpSendAccept(fd, fd, trans, signal); - state = 6; + if (state < 6) + state = 6; break; default: avdtpSendReject(fd, fd, trans, signal); @@ -717,7 +718,8 @@ do_ctlreq(int fd, short ev, void *arg) break; case AVDTP_SUSPEND: case AVDTP_START: - state = 6; + if (state < 6) + state = 6; break; default: avdtpSendReject(fd, fd, trans, signal); @@ -730,7 +732,7 @@ do_ctlreq(int fd, short ev, void *arg) if (state < 5 || state > 7) return; - if (asSpeaker) { + if (asSpeaker && state == 6) { len = sizeof(addr); if ((sc = accept(orighc,(struct sockaddr*)&addr, &len)) < 0) err(EXIT_FAILURE, "stream accept");