diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2016-05-24 14:09:34 +0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2016-05-24 14:15:31 +0300 |
commit | 14f93a68ba38aedb59c877d6c62eee17a89a2b7b (patch) | |
tree | 3d5780aa35cb53f8f6aa18c05daa6bfd276f7827 /src/profile.c | |
parent | a779ec83c9266e552174a7490d5e5f40483699a0 (diff) | |
download | bluez-14f93a68ba38aedb59c877d6c62eee17a89a2b7b.tar.gz |
profile: Fix accepting connections without an associated service
This fixes the flawed logic from the following commit:
commit b669604f43bbbf04ebaa66dd14ad9cfb005e561b
Author: Hsin-Yu Chao <hychao@chromium.org>
Date: Fri Apr 24 10:36:09 2015 -0700
src/profile: Set service to connecting in ext_connect
Diffstat (limited to 'src/profile.c')
-rw-r--r-- | src/profile.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/profile.c b/src/profile.c index 5a4f09ce9..c81a9f908 100644 --- a/src/profile.c +++ b/src/profile.c @@ -1047,10 +1047,11 @@ static void ext_connect(GIOChannel *io, GError *err, gpointer user_data) conn); } - if (conn->service && service_accept(conn->service) == 0) { - if (send_new_connection(ext, conn)) - return; - } + if (conn->service && service_accept(conn->service) < 0) + goto drop; + + if (send_new_connection(ext, conn)) + return; drop: if (conn->service) |