Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/usr.sbin/bta2dpd/bta2dpd Pull up following revision(s) (r...



details:   https://anonhg.NetBSD.org/src/rev/0c9827a8353b
branches:  netbsd-8
changeset: 850988:0c9827a8353b
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Aug 31 11:21:43 2017 +0000

description:
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.

diffstat:

 usr.sbin/bta2dpd/bta2dpd/bta2dpd.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r dc03694ff5f5 -r 0c9827a8353b usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
--- a/usr.sbin/bta2dpd/bta2dpd/bta2dpd.c        Thu Aug 31 11:19:58 2017 +0000
+++ b/usr.sbin/bta2dpd/bta2dpd/bta2dpd.c        Thu Aug 31 11:21:43 2017 +0000
@@ -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 <nathanialsloss%yahoo.com.au@localhost>
@@ -674,7 +674,8 @@
                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 @@
                        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 @@
        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");



Home | Main Index | Thread Index | Old Index