From 73f977e64d4c0fcb52fa6bbefdaa54fa250e35e8 Mon Sep 17 00:00:00 2001 From: Mikel Astiz Date: Fri, 26 Apr 2013 08:17:01 +0200 Subject: [PATCH] network: Fail if multiple profile instances Considerable parts codebase are assuming that there is one single instance of each UUID and therefore return an error during probe instead of silently ignoring duplicated entries. --- profiles/network/connection.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/profiles/network/connection.c b/profiles/network/connection.c index 3a913cfc6..3ccd21120 100644 --- a/profiles/network/connection.c +++ b/profiles/network/connection.c @@ -698,8 +698,11 @@ int connection_register(struct btd_device *device, uint16_t id) } nc = find_connection(peer->connections, id); - if (nc) - return 0; + if (nc) { + error("Device %s has multiple connection instances of %d", + device_get_path(device), id); + return -1; + } nc = g_new0(struct network_conn, 1); nc->id = id; -- 2.47.3