* [PATCH 1/2] neard: Fix checking for unknown carrier power state @ 2013-05-06 13:20 Szymon Janc 2013-05-06 13:20 ` [PATCH 2/2] neard: Fix reading local OOB data when adapter is not powered Szymon Janc 2013-05-08 7:13 ` [PATCH 1/2] neard: Fix checking for unknown carrier power state Johan Hedberg 0 siblings, 2 replies; 3+ messages in thread From: Szymon Janc @ 2013-05-06 13:20 UTC (permalink / raw) To: linux-bluetooth; +Cc: Samuel Ortiz, Szymon Janc Message might not contain State field and CPS needs to be set to unknown before processing message from neard. This fix processing RequestOOB called without parameters. --- plugins/neard.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/neard.c b/plugins/neard.c index f46e20e..dfe4f23 100644 --- a/plugins/neard.c +++ b/plugins/neard.c @@ -527,6 +527,9 @@ static int process_message(DBusMessage *msg, struct oob_params *remote) if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY) return -EINVAL; + /* set CPS to unknown in case State was not provided */ + remote->power_state = CPS_UNKNOWN; + dbus_message_iter_recurse(&iter, &dict); while (dbus_message_iter_get_arg_type(&dict) == DBUS_TYPE_DICT_ENTRY) { -- 1.8.2.2 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] neard: Fix reading local OOB data when adapter is not powered 2013-05-06 13:20 [PATCH 1/2] neard: Fix checking for unknown carrier power state Szymon Janc @ 2013-05-06 13:20 ` Szymon Janc 2013-05-08 7:13 ` [PATCH 1/2] neard: Fix checking for unknown carrier power state Johan Hedberg 1 sibling, 0 replies; 3+ messages in thread From: Szymon Janc @ 2013-05-06 13:20 UTC (permalink / raw) To: linux-bluetooth; +Cc: Samuel Ortiz, Szymon Janc Read Local OOB data only if adapter is powered. This fix replying with error instead of CPS set to inactive when adapter is not powered. --- plugins/neard.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/neard.c b/plugins/neard.c index dfe4f23..e4a4d71 100644 --- a/plugins/neard.c +++ b/plugins/neard.c @@ -790,7 +790,7 @@ static DBusMessage *request_oob(DBusConnection *conn, DBusMessage *msg, store_params(adapter, device, &remote); - if (!remote.hash) { + if (!remote.hash || !btd_adapter_get_powered(adapter)) { free_oob_params(&remote); return create_request_oob_reply(adapter, NULL, NULL, msg); } @@ -798,6 +798,9 @@ static DBusMessage *request_oob(DBusConnection *conn, DBusMessage *msg, read_local: free_oob_params(&remote); + if (!btd_adapter_get_powered(adapter)) + return create_request_oob_reply(adapter, NULL, NULL, msg); + err = btd_adapter_read_local_oob_data(adapter); if (err < 0) return error_reply(msg, -err); -- 1.8.2.2 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] neard: Fix checking for unknown carrier power state 2013-05-06 13:20 [PATCH 1/2] neard: Fix checking for unknown carrier power state Szymon Janc 2013-05-06 13:20 ` [PATCH 2/2] neard: Fix reading local OOB data when adapter is not powered Szymon Janc @ 2013-05-08 7:13 ` Johan Hedberg 1 sibling, 0 replies; 3+ messages in thread From: Johan Hedberg @ 2013-05-08 7:13 UTC (permalink / raw) To: Szymon Janc; +Cc: linux-bluetooth, Samuel Ortiz Hi Szymon, On Mon, May 06, 2013, Szymon Janc wrote: > Message might not contain State field and CPS needs to be set to > unknown before processing message from neard. This fix processing > RequestOOB called without parameters. > --- > plugins/neard.c | 3 +++ > 1 file changed, 3 insertions(+) Both patches have been applied. Thanks. Johan ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-05-08 7:13 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-05-06 13:20 [PATCH 1/2] neard: Fix checking for unknown carrier power state Szymon Janc 2013-05-06 13:20 ` [PATCH 2/2] neard: Fix reading local OOB data when adapter is not powered Szymon Janc 2013-05-08 7:13 ` [PATCH 1/2] neard: Fix checking for unknown carrier power state Johan Hedberg
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).