summaryrefslogtreecommitdiffstats
path: root/src/adapter.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-12-03 14:58:09 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2008-12-03 14:58:09 +0200
commitfbb20362e9dcaf11c03e5bf15c41c70aba269619 (patch)
treed5feaacf265fc3f10b44cf06c2f38478cca3ea0d /src/adapter.c
parent75feaf48401c04fb68e78c41213e26fdefa71ab9 (diff)
Fix agent creation checks
Allow the same process (D-Bus name) to own both the default (adapter specific) as well as a device specific agent.
Diffstat (limited to 'src/adapter.c')
-rw-r--r--src/adapter.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/adapter.c b/src/adapter.c
index b9bd74ab..865449c5 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -436,11 +436,20 @@ static struct bonding_request_info *bonding_request_new(DBusConnection *conn,
device_get_address(device, &bdaddr);
ba2str(&bdaddr, addr);
+ if (adapter->agent &&
+ agent_matches(adapter->agent, name, agent_path)) {
+ error("Refusing adapter agent usage as device specific one");
+ return NULL;
+ }
+
agent = agent_create(adapter, name, agent_path,
capability,
device_agent_removed,
device);
+ if (!agent)
+ debug("agent_create failed");
+
device_set_agent(device, agent);
debug("Temporary agent registered for hci%d/%s at %s:%s",