Search Linux Wireless

[PATCH 11/23] adapter: Do not poll when there is an active tag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When there is an active tag and a request to start polling is
received by neard, it will discard the currently registered tag
and requests that the kernel start another poll.  The kernel receives
this request and returns EBUSY because there is already an active tag.
neard receives this failure and reports it to the poll requestor.
At this point, the tag is active but neard no longer has any knowledge
of it.  Fix this by returning EBUSY when there is an active tag and
a new poll request is received.

Signed-off-by: Mark Greer <mgreer@xxxxxxxxxxxxxxx>
---
 src/adapter.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/adapter.c b/src/adapter.c
index eb1a407..9e3e75e 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -358,6 +358,9 @@ static DBusMessage *start_poll_loop(DBusConnection *conn,
 		return __near_error_failed(msg, ENODEV);
 	}
 
+	if (g_hash_table_size(adapter->tags) > 0)
+		return __near_error_failed(msg, EBUSY);
+
 	dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &dbus_mode,
 							DBUS_TYPE_INVALID);
 
-- 
2.13.0




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux