handsfree-audio: Reject SCO if agent is unavailable

This patch rejects the incoming SCO connection if there isn't a
Handsfree Audio Agent registered.
This commit is contained in:
Claudio Takahasi 2013-03-04 17:48:53 -03:00 committed by Denis Kenzior
parent a6874a64b2
commit 241e3ca74c
1 changed files with 6 additions and 0 deletions

View File

@ -123,6 +123,12 @@ static gboolean sco_accept(GIOChannel *io, GIOCondition cond,
if (nsk < 0)
return TRUE;
if (agent == NULL) {
ofono_error("Reject SCO: Agent not registered");
close(nsk);
return TRUE;
}
bt_ba2str(&saddr.sco_bdaddr, remote);
memset(&saddr, 0, sizeof(saddr));